Files
timebank-cc-public/public/build/assets/app-DRZ6ZsE1.js
T

139 lines
580 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cytoscape-fcose-Di-e6ZnW.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/jszip.min-KAUKf24L.js"])))=>i.map(i=>d[i]);
var VT=Object.defineProperty;var qT=(e,t,n)=>t in e?VT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ot=(e,t,n)=>qT(e,typeof t!="symbol"?t+"":t,n);import{c as Cl,g as zv}from"./_commonjsHelpers-Cpj98o6Y.js";const XT="modulepreload",YT=function(e){return"/build/"+e},ag={},af=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){let a=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=a(n.map(h=>{if(h=YT(h),h in ag)return;ag[h]=!0;const d=h.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":XT,d||(y.as="script"),y.crossOrigin="",y.href=h,u&&y.setAttribute("nonce",u),document.head.appendChild(y),d)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var So={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/var KT=So.exports,lg;function GT(){return lg||(lg=1,function(e,t){(function(){var n,i="4.17.23",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,d="__lodash_placeholder__",m=1,y=2,x=4,S=1,C=2,T=1,A=2,M=4,B=8,D=16,R=32,N=64,I=128,j=256,q=512,F=30,H="...",U=800,V=16,st=1,tt=2,it=3,K=1/0,ct=9007199254740991,dt=17976931348623157e292,_t=NaN,wt=4294967295,vt=wt-1,Ft=wt>>>1,xt=[["ary",I],["bind",T],["bindKey",A],["curry",B],["curryRight",D],["flip",q],["partial",R],["partialRight",N],["rearg",j]],Ct="[object Arguments]",Nt="[object Array]",be="[object AsyncFunction]",Ot="[object Boolean]",St="[object Date]",In="[object DOMException]",De="[object Error]",te="[object Function]",Le="[object GeneratorFunction]",re="[object Map]",oe="[object Number]",we="[object Null]",ye="[object Object]",Ve="[object Promise]",wn="[object Proxy]",he="[object RegExp]",Xt="[object Set]",xe="[object String]",Ae="[object Symbol]",xn="[object Undefined]",Yt="[object WeakMap]",Se="[object WeakSet]",fe="[object ArrayBuffer]",Z="[object DataView]",et="[object Float32Array]",ht="[object Float64Array]",lt="[object Int8Array]",Bt="[object Int16Array]",jt="[object Int32Array]",de="[object Uint8Array]",Ie="[object Uint8ClampedArray]",qe="[object Uint16Array]",Ne="[object Uint32Array]",Zi=/\b__p \+= '';/g,Qi=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,er=/&(?:amp|lt|gt|quot|#39);/g,Fr=/[&<>"']/g,Br=RegExp(er.source),Nn=RegExp(Fr.source),$t=/<%-([\s\S]+?)%>/g,_e=/<%([\s\S]+?)%>/g,Sn=/<%=([\s\S]+?)%>/g,Wc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jc=/^\w*$/,$c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ss=/[\\^$.*+?()[\]{}|]/g,Ei=RegExp(Ss.source),Ts=/^\s+/,la=/\s/,ca=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ua=/\{\n\/\* \[wrapped with (.+)\] \*/,ha=/,? & /,Uc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vc=/[()=,{}\[\]\/\s]/,qc=/\\(\\)?/g,Hr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fa=/\w*$/,da=/^[-+]0x[0-9a-f]+$/i,Xc=/^0b[01]+$/i,Yc=/^\[object .+?Constructor\]$/,Kc=/^0o[0-7]+$/i,Gc=/^(?:0|[1-9]\d*)$/,Jc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zr=/($^)/,Zc=/['\n\r\u2028\u2029\\]/g,Wr="\\ud800-\\udfff",pa="\\u0300-\\u036f",oi="\\ufe20-\\ufe2f",Qc="\\u20d0-\\u20ff",ga=pa+oi+Qc,ma="\\u2700-\\u27bf",va="a-z\\xdf-\\xf6\\xf8-\\xff",tu="\\xac\\xb1\\xd7\\xf7",eu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nu="\\u2000-\\u206f",iu=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ba="A-Z\\xc0-\\xd6\\xd8-\\xde",jr="\\ufe0e\\ufe0f",ya=tu+eu+nu+iu,Cs="['’]",Os="["+Wr+"]",_a="["+ya+"]",$r="["+ga+"]",wa="\\d+",ru="["+ma+"]",xa="["+va+"]",Sa="[^"+Wr+ya+wa+ma+va+ba+"]",ks="\\ud83c[\\udffb-\\udfff]",su="(?:"+$r+"|"+ks+")",Ur="[^"+Wr+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Es="[\\ud800-\\udbff][\\udc00-\\udfff]",Pi="["+ba+"]",Ta="\\u200d",Ca="(?:"+xa+"|"+Sa+")",ou="(?:"+Pi+"|"+Sa+")",Oa="(?:"+Cs+"(?:d|ll|m|re|s|t|ve))?",ka="(?:"+Cs+"(?:D|LL|M|RE|S|T|VE))?",Aa=su+"?",Ea="["+jr+"]?",Fn="(?:"+Ta+"(?:"+[Ur,As,Es].join("|")+")"+Ea+Aa+")*",au="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pa="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ma=Ea+Aa+Fn,ai="(?:"+[ru,As,Es].join("|")+")"+Ma,lu="(?:"+[Ur+$r+"?",$r,As,Es,Os].join("|")+")",Ps=RegExp(Cs,"g"),cu=RegExp($r,"g"),Ms=RegExp(ks+"(?="+ks+")|"+lu+Ma,"g"),uu=RegExp([Pi+"?"+xa+"+"+Oa+"(?="+[_a,Pi,"$"].join("|")+")",ou+"+"+ka+"(?="+[_a,Pi+Ca,"$"].join("|")+")",Pi+"?"+Ca+"+"+Oa,Pi+"+"+ka,Pa,au,wa,ai].join("|"),"g"),hu=RegExp("["+Ta+Wr+ga+jr+"]"),fu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rs=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],du=-1,qt={};qt[et]=qt[ht]=qt[lt]=qt[Bt]=qt[jt]=qt[de]=qt[Ie]=qt[qe]=qt[Ne]=!0,qt[Ct]=qt[Nt]=qt[fe]=qt[Ot]=qt[Z]=qt[St]=qt[De]=qt[te]=qt[re]=qt[oe]=qt[ye]=qt[he]=qt[Xt]=qt[xe]=qt[Yt]=!1;var Ut={};Ut[Ct]=Ut[Nt]=Ut[fe]=Ut[Z]=Ut[Ot]=Ut[St]=Ut[et]=Ut[ht]=Ut[lt]=Ut[Bt]=Ut[jt]=Ut[re]=Ut[oe]=Ut[ye]=Ut[he]=Ut[Xt]=Ut[xe]=Ut[Ae]=Ut[de]=Ut[Ie]=Ut[qe]=Ut[Ne]=!0,Ut[De]=Ut[te]=Ut[Yt]=!1;var pu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},gu={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},nr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},mu=parseFloat,vu=parseInt,Mi=typeof Cl=="object"&&Cl&&Cl.Object===Object&&Cl,bu=typeof self=="object"&&self&&self.Object===Object&&self,Te=Mi||bu||Function("return this")(),Ds=t&&!t.nodeType&&t,li=Ds&&!0&&e&&!e.nodeType&&e,Ra=li&&li.exports===Ds,Ls=Ra&&Mi.process,Qe=function(){try{var b=li&&li.require&&li.require("util").types;return b||Ls&&Ls.binding&&Ls.binding("util")}catch{}}(),Da=Qe&&Qe.isArrayBuffer,La=Qe&&Qe.isDate,qr=Qe&&Qe.isMap,Vn=Qe&&Qe.isRegExp,Ia=Qe&&Qe.isSet,Na=Qe&&Qe.isTypedArray;function Xe(b,w,O){switch(O.length){case 0:return b.call(w);case 1:return b.call(w,O[0]);case 2:return b.call(w,O[0],O[1]);case 3:return b.call(w,O[0],O[1],O[2])}return b.apply(w,O)}function yu(b,w,O,W){for(var Y=-1,rt=b==null?0:b.length;++Y<rt;){var nt=b[Y];w(W,nt,O(nt),b)}return W}function Ye(b,w){for(var O=-1,W=b==null?0:b.length;++O<W&&w(b[O],O,b)!==!1;);return b}function _u(b,w){for(var O=b==null?0:b.length;O--&&w(b[O],O,b)!==!1;);return b}function Is(b,w){for(var O=-1,W=b==null?0:b.length;++O<W;)if(!w(b[O],O,b))return!1;return!0}function qn(b,w){for(var O=-1,W=b==null?0:b.length,Y=0,rt=[];++O<W;){var nt=b[O];w(nt,O,b)&&(rt[Y++]=nt)}return rt}function Xr(b,w){var O=b==null?0:b.length;return!!O&&Yn(b,w,0)>-1}function Ns(b,w,O){for(var W=-1,Y=b==null?0:b.length;++W<Y;)if(O(w,b[W]))return!0;return!1}function Kt(b,w){for(var O=-1,W=b==null?0:b.length,Y=Array(W);++O<W;)Y[O]=w(b[O],O,b);return Y}function Xn(b,w){for(var O=-1,W=w.length,Y=b.length;++O<W;)b[Y+O]=w[O];return b}function Fs(b,w,O,W){var Y=-1,rt=b==null?0:b.length;for(W&&rt&&(O=b[++Y]);++Y<rt;)O=w(O,b[Y],Y,b);return O}function wu(b,w,O,W){var Y=b==null?0:b.length;for(W&&Y&&(O=b[--Y]);Y--;)O=w(O,b[Y],Y,b);return O}function Bs(b,w){for(var O=-1,W=b==null?0:b.length;++O<W;)if(w(b[O],O,b))return!0;return!1}var xu=Hs("length");function Fa(b){return b.split("")}function Su(b){return b.match(Uc)||[]}function Ba(b,w,O){var W;return O(b,function(Y,rt,nt){if(w(Y,rt,nt))return W=rt,!1}),W}function yt(b,w,O,W){for(var Y=b.length,rt=O+(W?1:-1);W?rt--:++rt<Y;)if(w(b[rt],rt,b))return rt;return-1}function Yn(b,w,O){return w===w?Ru(b,w,O):yt(b,Ha,O)}function Yr(b,w,O,W){for(var Y=O-1,rt=b.length;++Y<rt;)if(W(b[Y],w))return Y;return-1}function Ha(b){return b!==b}function za(b,w){var O=b==null?0:b.length;return O?js(b,w)/O:_t}function Hs(b){return function(w){return w==null?n:w[b]}}function zs(b){return function(w){return b==null?n:b[w]}}function Ws(b,w,O,W,Y){return Y(b,function(rt,nt,ut){O=W?(W=!1,rt):w(O,rt,nt,ut)}),O}function Tu(b,w){var O=b.length;for(b.sort(w);O--;)b[O]=b[O].value;return b}function js(b,w){for(var O,W=-1,Y=b.length;++W<Y;){var rt=w(b[W]);rt!==n&&(O=O===n?rt:O+rt)}return O}function $s(b,w){for(var O=-1,W=Array(b);++O<b;)W[O]=w(O);return W}function Cu(b,w){return Kt(w,function(O){return[O,b[O]]})}function Wa(b){return b&&b.slice(0,qa(b)+1).replace(Ts,"")}function Ke(b){return function(w){return b(w)}}function Us(b,w){return Kt(w,function(O){return b[O]})}function ir(b,w){return b.has(w)}function ja(b,w){for(var O=-1,W=b.length;++O<W&&Yn(w,b[O],0)>-1;);return O}function $a(b,w){for(var O=b.length;O--&&Yn(w,b[O],0)>-1;);return O}function Ri(b,w){for(var O=b.length,W=0;O--;)b[O]===w&&++W;return W}var Ou=zs(pu),ku=zs(Vr);function Au(b){return"\\"+nr[b]}function Ua(b,w){return b==null?n:b[w]}function Di(b){return hu.test(b)}function Eu(b){return fu.test(b)}function Pu(b){for(var w,O=[];!(w=b.next()).done;)O.push(w.value);return O}function Vs(b){var w=-1,O=Array(b.size);return b.forEach(function(W,Y){O[++w]=[Y,W]}),O}function Va(b,w){return function(O){return b(w(O))}}function Kn(b,w){for(var O=-1,W=b.length,Y=0,rt=[];++O<W;){var nt=b[O];(nt===w||nt===d)&&(b[O]=d,rt[Y++]=O)}return rt}function Kr(b){var w=-1,O=Array(b.size);return b.forEach(function(W){O[++w]=W}),O}function Mu(b){var w=-1,O=Array(b.size);return b.forEach(function(W){O[++w]=[W,W]}),O}function Ru(b,w,O){for(var W=O-1,Y=b.length;++W<Y;)if(b[W]===w)return W;return-1}function Du(b,w,O){for(var W=O+1;W--;)if(b[W]===w)return W;return W}function Li(b){return Di(b)?qs(b):xu(b)}function pn(b){return Di(b)?Lu(b):Fa(b)}function qa(b){for(var w=b.length;w--&&la.test(b.charAt(w)););return w}var Xa=zs(gu);function qs(b){for(var w=Ms.lastIndex=0;Ms.test(b);)++w;return w}function Lu(b){return b.match(Ms)||[]}function v(b){return b.match(uu)||[]}var p=function b(w){w=w==null?Te:g.defaults(Te.Object(),w,g.pick(Te,Rs));var O=w.Array,W=w.Date,Y=w.Error,rt=w.Function,nt=w.Math,ut=w.Object,ee=w.RegExp,Tn=w.String,tn=w.TypeError,rr=O.prototype,Iu=rt.prototype,ci=ut.prototype,Gr=w["__core-js_shared__"],sr=Iu.toString,Ht=ci.hasOwnProperty,Nu=0,Xs=function(){var o=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),or=ci.toString,Ya=sr.call(ut),Ys=Te._,Ks=ee("^"+sr.call(Ht).replace(Ss,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=Ra?w.Buffer:n,Gn=w.Symbol,Jr=w.Uint8Array,Ka=ar?ar.allocUnsafe:n,Zr=Va(ut.getPrototypeOf,ut),Gs=ut.create,wd=ci.propertyIsEnumerable,Ga=rr.splice,xd=Gn?Gn.isConcatSpreadable:n,Js=Gn?Gn.iterator:n,lr=Gn?Gn.toStringTag:n,Ja=function(){try{var o=dr(ut,"defineProperty");return o({},"",{}),o}catch{}}(),Uy=w.clearTimeout!==Te.clearTimeout&&w.clearTimeout,Vy=W&&W.now!==Te.Date.now&&W.now,qy=w.setTimeout!==Te.setTimeout&&w.setTimeout,Za=nt.ceil,Qa=nt.floor,Fu=ut.getOwnPropertySymbols,Xy=ar?ar.isBuffer:n,Sd=w.isFinite,Yy=rr.join,Ky=Va(ut.keys,ut),Ce=nt.max,Be=nt.min,Gy=W.now,Jy=w.parseInt,Td=nt.random,Zy=rr.reverse,Bu=dr(w,"DataView"),Zs=dr(w,"Map"),Hu=dr(w,"Promise"),Qr=dr(w,"Set"),Qs=dr(w,"WeakMap"),to=dr(ut,"create"),tl=Qs&&new Qs,ts={},Qy=pr(Bu),t0=pr(Zs),e0=pr(Hu),n0=pr(Qr),i0=pr(Qs),el=Gn?Gn.prototype:n,eo=el?el.valueOf:n,Cd=el?el.toString:n;function E(o){if(ae(o)&&!kt(o)&&!(o instanceof Dt)){if(o instanceof Cn)return o;if(Ht.call(o,"__wrapped__"))return Op(o)}return new Cn(o)}var es=function(){function o(){}return function(c){if(!se(c))return{};if(Gs)return Gs(c);o.prototype=c;var f=new o;return o.prototype=n,f}}();function nl(){}function Cn(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}E.templateSettings={escape:$t,evaluate:_e,interpolate:Sn,variable:"",imports:{_:E}},E.prototype=nl.prototype,E.prototype.constructor=E,Cn.prototype=es(nl.prototype),Cn.prototype.constructor=Cn;function Dt(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=wt,this.__views__=[]}function r0(){var o=new Dt(this.__wrapped__);return o.__actions__=en(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=en(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=en(this.__views__),o}function s0(){if(this.__filtered__){var o=new Dt(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function o0(){var o=this.__wrapped__.value(),c=this.__dir__,f=kt(o),_=c<0,k=f?o.length:0,P=b_(0,k,this.__views__),L=P.start,z=P.end,$=z-L,G=_?z:L-1,J=this.__iteratees__,Q=J.length,at=0,ft=Be($,this.__takeCount__);if(!f||!_&&k==$&&ft==$)return Kd(o,this.__actions__);var gt=[];t:for(;$--&&at<ft;){G+=c;for(var Et=-1,mt=o[G];++Et<Q;){var Mt=J[Et],It=Mt.iteratee,vn=Mt.type,Ze=It(mt);if(vn==tt)mt=Ze;else if(!Ze){if(vn==st)continue t;break t}}gt[at++]=mt}return gt}Dt.prototype=es(nl.prototype),Dt.prototype.constructor=Dt;function cr(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var _=o[c];this.set(_[0],_[1])}}function a0(){this.__data__=to?to(null):{},this.size=0}function l0(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function c0(o){var c=this.__data__;if(to){var f=c[o];return f===u?n:f}return Ht.call(c,o)?c[o]:n}function u0(o){var c=this.__data__;return to?c[o]!==n:Ht.call(c,o)}function h0(o,c){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=to&&c===n?u:c,this}cr.prototype.clear=a0,cr.prototype.delete=l0,cr.prototype.get=c0,cr.prototype.has=u0,cr.prototype.set=h0;function ui(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var _=o[c];this.set(_[0],_[1])}}function f0(){this.__data__=[],this.size=0}function d0(o){var c=this.__data__,f=il(c,o);if(f<0)return!1;var _=c.length-1;return f==_?c.pop():Ga.call(c,f,1),--this.size,!0}function p0(o){var c=this.__data__,f=il(c,o);return f<0?n:c[f][1]}function g0(o){return il(this.__data__,o)>-1}function m0(o,c){var f=this.__data__,_=il(f,o);return _<0?(++this.size,f.push([o,c])):f[_][1]=c,this}ui.prototype.clear=f0,ui.prototype.delete=d0,ui.prototype.get=p0,ui.prototype.has=g0,ui.prototype.set=m0;function hi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var _=o[c];this.set(_[0],_[1])}}function v0(){this.size=0,this.__data__={hash:new cr,map:new(Zs||ui),string:new cr}}function b0(o){var c=gl(this,o).delete(o);return this.size-=c?1:0,c}function y0(o){return gl(this,o).get(o)}function _0(o){return gl(this,o).has(o)}function w0(o,c){var f=gl(this,o),_=f.size;return f.set(o,c),this.size+=f.size==_?0:1,this}hi.prototype.clear=v0,hi.prototype.delete=b0,hi.prototype.get=y0,hi.prototype.has=_0,hi.prototype.set=w0;function ur(o){var c=-1,f=o==null?0:o.length;for(this.__data__=new hi;++c<f;)this.add(o[c])}function x0(o){return this.__data__.set(o,u),this}function S0(o){return this.__data__.has(o)}ur.prototype.add=ur.prototype.push=x0,ur.prototype.has=S0;function Bn(o){var c=this.__data__=new ui(o);this.size=c.size}function T0(){this.__data__=new ui,this.size=0}function C0(o){var c=this.__data__,f=c.delete(o);return this.size=c.size,f}function O0(o){return this.__data__.get(o)}function k0(o){return this.__data__.has(o)}function A0(o,c){var f=this.__data__;if(f instanceof ui){var _=f.__data__;if(!Zs||_.length<r-1)return _.push([o,c]),this.size=++f.size,this;f=this.__data__=new hi(_)}return f.set(o,c),this.size=f.size,this}Bn.prototype.clear=T0,Bn.prototype.delete=C0,Bn.prototype.get=O0,Bn.prototype.has=k0,Bn.prototype.set=A0;function Od(o,c){var f=kt(o),_=!f&&gr(o),k=!f&&!_&&Hi(o),P=!f&&!_&&!k&&ss(o),L=f||_||k||P,z=L?$s(o.length,Tn):[],$=z.length;for(var G in o)(c||Ht.call(o,G))&&!(L&&(G=="length"||k&&(G=="offset"||G=="parent")||P&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||gi(G,$)))&&z.push(G);return z}function kd(o){var c=o.length;return c?o[Gu(0,c-1)]:n}function E0(o,c){return ml(en(o),hr(c,0,o.length))}function P0(o){return ml(en(o))}function zu(o,c,f){(f!==n&&!Hn(o[c],f)||f===n&&!(c in o))&&fi(o,c,f)}function no(o,c,f){var _=o[c];(!(Ht.call(o,c)&&Hn(_,f))||f===n&&!(c in o))&&fi(o,c,f)}function il(o,c){for(var f=o.length;f--;)if(Hn(o[f][0],c))return f;return-1}function M0(o,c,f,_){return Ii(o,function(k,P,L){c(_,k,f(k),L)}),_}function Ad(o,c){return o&&Zn(c,Ee(c),o)}function R0(o,c){return o&&Zn(c,rn(c),o)}function fi(o,c,f){c=="__proto__"&&Ja?Ja(o,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[c]=f}function Wu(o,c){for(var f=-1,_=c.length,k=O(_),P=o==null;++f<_;)k[f]=P?n:wh(o,c[f]);return k}function hr(o,c,f){return o===o&&(f!==n&&(o=o<=f?o:f),c!==n&&(o=o>=c?o:c)),o}function On(o,c,f,_,k,P){var L,z=c&m,$=c&y,G=c&x;if(f&&(L=k?f(o,_,k,P):f(o)),L!==n)return L;if(!se(o))return o;var J=kt(o);if(J){if(L=__(o),!z)return en(o,L)}else{var Q=He(o),at=Q==te||Q==Le;if(Hi(o))return Zd(o,z);if(Q==ye||Q==Ct||at&&!k){if(L=$||at?{}:vp(o),!z)return $?c_(o,R0(L,o)):l_(o,Ad(L,o))}else{if(!Ut[Q])return k?o:{};L=w_(o,Q,z)}}P||(P=new Bn);var ft=P.get(o);if(ft)return ft;P.set(o,L),qp(o)?o.forEach(function(mt){L.add(On(mt,c,f,mt,o,P))}):Up(o)&&o.forEach(function(mt,Mt){L.set(Mt,On(mt,c,f,Mt,o,P))});var gt=G?$?ah:oh:$?rn:Ee,Et=J?n:gt(o);return Ye(Et||o,function(mt,Mt){Et&&(Mt=mt,mt=o[Mt]),no(L,Mt,On(mt,c,f,Mt,o,P))}),L}function D0(o){var c=Ee(o);return function(f){return Ed(f,o,c)}}function Ed(o,c,f){var _=f.length;if(o==null)return!_;for(o=ut(o);_--;){var k=f[_],P=c[k],L=o[k];if(L===n&&!(k in o)||!P(L))return!1}return!0}function Pd(o,c,f){if(typeof o!="function")throw new tn(a);return uo(function(){o.apply(n,f)},c)}function ro(o,c,f,_){var k=-1,P=Xr,L=!0,z=o.length,$=[],G=c.length;if(!z)return $;f&&(c=Kt(c,Ke(f))),_?(P=Ns,L=!1):c.length>=r&&(P=ir,L=!1,c=new ur(c));t:for(;++k<z;){var J=o[k],Q=f==null?J:f(J);if(J=_||J!==0?J:0,L&&Q===Q){for(var at=G;at--;)if(c[at]===Q)continue t;$.push(J)}else P(c,Q,_)||$.push(J)}return $}var Ii=ip(Jn),Md=ip($u,!0);function L0(o,c){var f=!0;return Ii(o,function(_,k,P){return f=!!c(_,k,P),f}),f}function rl(o,c,f){for(var _=-1,k=o.length;++_<k;){var P=o[_],L=c(P);if(L!=null&&(z===n?L===L&&!mn(L):f(L,z)))var z=L,$=P}return $}function I0(o,c,f,_){var k=o.length;for(f=At(f),f<0&&(f=-f>k?0:k+f),_=_===n||_>k?k:At(_),_<0&&(_+=k),_=f>_?0:Yp(_);f<_;)o[f++]=c;return o}function Rd(o,c){var f=[];return Ii(o,function(_,k,P){c(_,k,P)&&f.push(_)}),f}function Fe(o,c,f,_,k){var P=-1,L=o.length;for(f||(f=S_),k||(k=[]);++P<L;){var z=o[P];c>0&&f(z)?c>1?Fe(z,c-1,f,_,k):Xn(k,z):_||(k[k.length]=z)}return k}var ju=rp(),Dd=rp(!0);function Jn(o,c){return o&&ju(o,c,Ee)}function $u(o,c){return o&&Dd(o,c,Ee)}function sl(o,c){return qn(c,function(f){return mi(o[f])})}function fr(o,c){c=Fi(c,o);for(var f=0,_=c.length;o!=null&&f<_;)o=o[Qn(c[f++])];return f&&f==_?o:n}function Ld(o,c,f){var _=c(o);return kt(o)?_:Xn(_,f(o))}function Ge(o){return o==null?o===n?xn:we:lr&&lr in ut(o)?v_(o):P_(o)}function Uu(o,c){return o>c}function N0(o,c){return o!=null&&Ht.call(o,c)}function F0(o,c){return o!=null&&c in ut(o)}function B0(o,c,f){return o>=Be(c,f)&&o<Ce(c,f)}function Vu(o,c,f){for(var _=f?Ns:Xr,k=o[0].length,P=o.length,L=P,z=O(P),$=1/0,G=[];L--;){var J=o[L];L&&c&&(J=Kt(J,Ke(c))),$=Be(J.length,$),z[L]=!f&&(c||k>=120&&J.length>=120)?new ur(L&&J):n}J=o[0];var Q=-1,at=z[0];t:for(;++Q<k&&G.length<$;){var ft=J[Q],gt=c?c(ft):ft;if(ft=f||ft!==0?ft:0,!(at?ir(at,gt):_(G,gt,f))){for(L=P;--L;){var Et=z[L];if(!(Et?ir(Et,gt):_(o[L],gt,f)))continue t}at&&at.push(gt),G.push(ft)}}return G}function H0(o,c,f,_){return Jn(o,function(k,P,L){c(_,f(k),P,L)}),_}function so(o,c,f){c=Fi(c,o),o=wp(o,c);var _=o==null?o:o[Qn(An(c))];return _==null?n:Xe(_,o,f)}function Id(o){return ae(o)&&Ge(o)==Ct}function z0(o){return ae(o)&&Ge(o)==fe}function W0(o){return ae(o)&&Ge(o)==St}function oo(o,c,f,_,k){return o===c?!0:o==null||c==null||!ae(o)&&!ae(c)?o!==o&&c!==c:j0(o,c,f,_,oo,k)}function j0(o,c,f,_,k,P){var L=kt(o),z=kt(c),$=L?Nt:He(o),G=z?Nt:He(c);$=$==Ct?ye:$,G=G==Ct?ye:G;var J=$==ye,Q=G==ye,at=$==G;if(at&&Hi(o)){if(!Hi(c))return!1;L=!0,J=!1}if(at&&!J)return P||(P=new Bn),L||ss(o)?pp(o,c,f,_,k,P):g_(o,c,$,f,_,k,P);if(!(f&S)){var ft=J&&Ht.call(o,"__wrapped__"),gt=Q&&Ht.call(c,"__wrapped__");if(ft||gt){var Et=ft?o.value():o,mt=gt?c.value():c;return P||(P=new Bn),k(Et,mt,f,_,P)}}return at?(P||(P=new Bn),m_(o,c,f,_,k,P)):!1}function $0(o){return ae(o)&&He(o)==re}function qu(o,c,f,_){var k=f.length,P=k,L=!_;if(o==null)return!P;for(o=ut(o);k--;){var z=f[k];if(L&&z[2]?z[1]!==o[z[0]]:!(z[0]in o))return!1}for(;++k<P;){z=f[k];var $=z[0],G=o[$],J=z[1];if(L&&z[2]){if(G===n&&!($ in o))return!1}else{var Q=new Bn;if(_)var at=_(G,J,$,o,c,Q);if(!(at===n?oo(J,G,S|C,_,Q):at))return!1}}return!0}function Nd(o){if(!se(o)||C_(o))return!1;var c=mi(o)?Ks:Yc;return c.test(pr(o))}function U0(o){return ae(o)&&Ge(o)==he}function V0(o){return ae(o)&&He(o)==Xt}function q0(o){return ae(o)&&xl(o.length)&&!!qt[Ge(o)]}function Fd(o){return typeof o=="function"?o:o==null?sn:typeof o=="object"?kt(o)?zd(o[0],o[1]):Hd(o):sg(o)}function Xu(o){if(!co(o))return Ky(o);var c=[];for(var f in ut(o))Ht.call(o,f)&&f!="constructor"&&c.push(f);return c}function X0(o){if(!se(o))return E_(o);var c=co(o),f=[];for(var _ in o)_=="constructor"&&(c||!Ht.call(o,_))||f.push(_);return f}function Yu(o,c){return o<c}function Bd(o,c){var f=-1,_=nn(o)?O(o.length):[];return Ii(o,function(k,P,L){_[++f]=c(k,P,L)}),_}function Hd(o){var c=ch(o);return c.length==1&&c[0][2]?yp(c[0][0],c[0][1]):function(f){return f===o||qu(f,o,c)}}function zd(o,c){return hh(o)&&bp(c)?yp(Qn(o),c):function(f){var _=wh(f,o);return _===n&&_===c?xh(f,o):oo(c,_,S|C)}}function ol(o,c,f,_,k){o!==c&&ju(c,function(P,L){if(k||(k=new Bn),se(P))Y0(o,c,L,f,ol,_,k);else{var z=_?_(dh(o,L),P,L+"",o,c,k):n;z===n&&(z=P),zu(o,L,z)}},rn)}function Y0(o,c,f,_,k,P,L){var z=dh(o,f),$=dh(c,f),G=L.get($);if(G){zu(o,f,G);return}var J=P?P(z,$,f+"",o,c,L):n,Q=J===n;if(Q){var at=kt($),ft=!at&&Hi($),gt=!at&&!ft&&ss($);J=$,at||ft||gt?kt(z)?J=z:pe(z)?J=en(z):ft?(Q=!1,J=Zd($,!0)):gt?(Q=!1,J=Qd($,!0)):J=[]:ho($)||gr($)?(J=z,gr(z)?J=Kp(z):(!se(z)||mi(z))&&(J=vp($))):Q=!1}Q&&(L.set($,J),k(J,$,_,P,L),L.delete($)),zu(o,f,J)}function Wd(o,c){var f=o.length;if(f)return c+=c<0?f:0,gi(c,f)?o[c]:n}function jd(o,c,f){c.length?c=Kt(c,function(P){return kt(P)?function(L){return fr(L,P.length===1?P[0]:P)}:P}):c=[sn];var _=-1;c=Kt(c,Ke(pt()));var k=Bd(o,function(P,L,z){var $=Kt(c,function(G){return G(P)});return{criteria:$,index:++_,value:P}});return Tu(k,function(P,L){return a_(P,L,f)})}function K0(o,c){return $d(o,c,function(f,_){return xh(o,_)})}function $d(o,c,f){for(var _=-1,k=c.length,P={};++_<k;){var L=c[_],z=fr(o,L);f(z,L)&&ao(P,Fi(L,o),z)}return P}function G0(o){return function(c){return fr(c,o)}}function Ku(o,c,f,_){var k=_?Yr:Yn,P=-1,L=c.length,z=o;for(o===c&&(c=en(c)),f&&(z=Kt(o,Ke(f)));++P<L;)for(var $=0,G=c[P],J=f?f(G):G;($=k(z,J,$,_))>-1;)z!==o&&Ga.call(z,$,1),Ga.call(o,$,1);return o}function Ud(o,c){for(var f=o?c.length:0,_=f-1;f--;){var k=c[f];if(f==_||k!==P){var P=k;gi(k)?Ga.call(o,k,1):Qu(o,k)}}return o}function Gu(o,c){return o+Qa(Td()*(c-o+1))}function J0(o,c,f,_){for(var k=-1,P=Ce(Za((c-o)/(f||1)),0),L=O(P);P--;)L[_?P:++k]=o,o+=f;return L}function Ju(o,c){var f="";if(!o||c<1||c>ct)return f;do c%2&&(f+=o),c=Qa(c/2),c&&(o+=o);while(c);return f}function Pt(o,c){return ph(_p(o,c,sn),o+"")}function Z0(o){return kd(os(o))}function Q0(o,c){var f=os(o);return ml(f,hr(c,0,f.length))}function ao(o,c,f,_){if(!se(o))return o;c=Fi(c,o);for(var k=-1,P=c.length,L=P-1,z=o;z!=null&&++k<P;){var $=Qn(c[k]),G=f;if($==="__proto__"||$==="constructor"||$==="prototype")return o;if(k!=L){var J=z[$];G=_?_(J,$,z):n,G===n&&(G=se(J)?J:gi(c[k+1])?[]:{})}no(z,$,G),z=z[$]}return o}var Vd=tl?function(o,c){return tl.set(o,c),o}:sn,t_=Ja?function(o,c){return Ja(o,"toString",{configurable:!0,enumerable:!1,value:Th(c),writable:!0})}:sn;function e_(o){return ml(os(o))}function kn(o,c,f){var _=-1,k=o.length;c<0&&(c=-c>k?0:k+c),f=f>k?k:f,f<0&&(f+=k),k=c>f?0:f-c>>>0,c>>>=0;for(var P=O(k);++_<k;)P[_]=o[_+c];return P}function n_(o,c){var f;return Ii(o,function(_,k,P){return f=c(_,k,P),!f}),!!f}function al(o,c,f){var _=0,k=o==null?_:o.length;if(typeof c=="number"&&c===c&&k<=Ft){for(;_<k;){var P=_+k>>>1,L=o[P];L!==null&&!mn(L)&&(f?L<=c:L<c)?_=P+1:k=P}return k}return Zu(o,c,sn,f)}function Zu(o,c,f,_){var k=0,P=o==null?0:o.length;if(P===0)return 0;c=f(c);for(var L=c!==c,z=c===null,$=mn(c),G=c===n;k<P;){var J=Qa((k+P)/2),Q=f(o[J]),at=Q!==n,ft=Q===null,gt=Q===Q,Et=mn(Q);if(L)var mt=_||gt;else G?mt=gt&&(_||at):z?mt=gt&&at&&(_||!ft):$?mt=gt&&at&&!ft&&(_||!Et):ft||Et?mt=!1:mt=_?Q<=c:Q<c;mt?k=J+1:P=J}return Be(P,vt)}function qd(o,c){for(var f=-1,_=o.length,k=0,P=[];++f<_;){var L=o[f],z=c?c(L):L;if(!f||!Hn(z,$)){var $=z;P[k++]=L===0?0:L}}return P}function Xd(o){return typeof o=="number"?o:mn(o)?_t:+o}function gn(o){if(typeof o=="string")return o;if(kt(o))return Kt(o,gn)+"";if(mn(o))return Cd?Cd.call(o):"";var c=o+"";return c=="0"&&1/o==-K?"-0":c}function Ni(o,c,f){var _=-1,k=Xr,P=o.length,L=!0,z=[],$=z;if(f)L=!1,k=Ns;else if(P>=r){var G=c?null:d_(o);if(G)return Kr(G);L=!1,k=ir,$=new ur}else $=c?[]:z;t:for(;++_<P;){var J=o[_],Q=c?c(J):J;if(J=f||J!==0?J:0,L&&Q===Q){for(var at=$.length;at--;)if($[at]===Q)continue t;c&&$.push(Q),z.push(J)}else k($,Q,f)||($!==z&&$.push(Q),z.push(J))}return z}function Qu(o,c){c=Fi(c,o);var f=-1,_=c.length;if(!_)return!0;for(var k=o==null||typeof o!="object"&&typeof o!="function";++f<_;){var P=c[f];if(typeof P=="string"){if(P==="__proto__"&&!Ht.call(o,"__proto__"))return!1;if(P==="constructor"&&f+1<_&&typeof c[f+1]=="string"&&c[f+1]==="prototype"){if(k&&f===0)continue;return!1}}}var L=wp(o,c);return L==null||delete L[Qn(An(c))]}function Yd(o,c,f,_){return ao(o,c,f(fr(o,c)),_)}function ll(o,c,f,_){for(var k=o.length,P=_?k:-1;(_?P--:++P<k)&&c(o[P],P,o););return f?kn(o,_?0:P,_?P+1:k):kn(o,_?P+1:0,_?k:P)}function Kd(o,c){var f=o;return f instanceof Dt&&(f=f.value()),Fs(c,function(_,k){return k.func.apply(k.thisArg,Xn([_],k.args))},f)}function th(o,c,f){var _=o.length;if(_<2)return _?Ni(o[0]):[];for(var k=-1,P=O(_);++k<_;)for(var L=o[k],z=-1;++z<_;)z!=k&&(P[k]=ro(P[k]||L,o[z],c,f));return Ni(Fe(P,1),c,f)}function Gd(o,c,f){for(var _=-1,k=o.length,P=c.length,L={};++_<k;){var z=_<P?c[_]:n;f(L,o[_],z)}return L}function eh(o){return pe(o)?o:[]}function nh(o){return typeof o=="function"?o:sn}function Fi(o,c){return kt(o)?o:hh(o,c)?[o]:Cp(Wt(o))}var i_=Pt;function Bi(o,c,f){var _=o.length;return f=f===n?_:f,!c&&f>=_?o:kn(o,c,f)}var Jd=Uy||function(o){return Te.clearTimeout(o)};function Zd(o,c){if(c)return o.slice();var f=o.length,_=Ka?Ka(f):new o.constructor(f);return o.copy(_),_}function ih(o){var c=new o.constructor(o.byteLength);return new Jr(c).set(new Jr(o)),c}function r_(o,c){var f=c?ih(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function s_(o){var c=new o.constructor(o.source,fa.exec(o));return c.lastIndex=o.lastIndex,c}function o_(o){return eo?ut(eo.call(o)):{}}function Qd(o,c){var f=c?ih(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function tp(o,c){if(o!==c){var f=o!==n,_=o===null,k=o===o,P=mn(o),L=c!==n,z=c===null,$=c===c,G=mn(c);if(!z&&!G&&!P&&o>c||P&&L&&$&&!z&&!G||_&&L&&$||!f&&$||!k)return 1;if(!_&&!P&&!G&&o<c||G&&f&&k&&!_&&!P||z&&f&&k||!L&&k||!$)return-1}return 0}function a_(o,c,f){for(var _=-1,k=o.criteria,P=c.criteria,L=k.length,z=f.length;++_<L;){var $=tp(k[_],P[_]);if($){if(_>=z)return $;var G=f[_];return $*(G=="desc"?-1:1)}}return o.index-c.index}function ep(o,c,f,_){for(var k=-1,P=o.length,L=f.length,z=-1,$=c.length,G=Ce(P-L,0),J=O($+G),Q=!_;++z<$;)J[z]=c[z];for(;++k<L;)(Q||k<P)&&(J[f[k]]=o[k]);for(;G--;)J[z++]=o[k++];return J}function np(o,c,f,_){for(var k=-1,P=o.length,L=-1,z=f.length,$=-1,G=c.length,J=Ce(P-z,0),Q=O(J+G),at=!_;++k<J;)Q[k]=o[k];for(var ft=k;++$<G;)Q[ft+$]=c[$];for(;++L<z;)(at||k<P)&&(Q[ft+f[L]]=o[k++]);return Q}function en(o,c){var f=-1,_=o.length;for(c||(c=O(_));++f<_;)c[f]=o[f];return c}function Zn(o,c,f,_){var k=!f;f||(f={});for(var P=-1,L=c.length;++P<L;){var z=c[P],$=_?_(f[z],o[z],z,f,o):n;$===n&&($=o[z]),k?fi(f,z,$):no(f,z,$)}return f}function l_(o,c){return Zn(o,uh(o),c)}function c_(o,c){return Zn(o,gp(o),c)}function cl(o,c){return function(f,_){var k=kt(f)?yu:M0,P=c?c():{};return k(f,o,pt(_,2),P)}}function ns(o){return Pt(function(c,f){var _=-1,k=f.length,P=k>1?f[k-1]:n,L=k>2?f[2]:n;for(P=o.length>3&&typeof P=="function"?(k--,P):n,L&&Je(f[0],f[1],L)&&(P=k<3?n:P,k=1),c=ut(c);++_<k;){var z=f[_];z&&o(c,z,_,P)}return c})}function ip(o,c){return function(f,_){if(f==null)return f;if(!nn(f))return o(f,_);for(var k=f.length,P=c?k:-1,L=ut(f);(c?P--:++P<k)&&_(L[P],P,L)!==!1;);return f}}function rp(o){return function(c,f,_){for(var k=-1,P=ut(c),L=_(c),z=L.length;z--;){var $=L[o?z:++k];if(f(P[$],$,P)===!1)break}return c}}function u_(o,c,f){var _=c&T,k=lo(o);function P(){var L=this&&this!==Te&&this instanceof P?k:o;return L.apply(_?f:this,arguments)}return P}function sp(o){return function(c){c=Wt(c);var f=Di(c)?pn(c):n,_=f?f[0]:c.charAt(0),k=f?Bi(f,1).join(""):c.slice(1);return _[o]()+k}}function is(o){return function(c){return Fs(ig(ng(c).replace(Ps,"")),o,"")}}function lo(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=es(o.prototype),_=o.apply(f,c);return se(_)?_:f}}function h_(o,c,f){var _=lo(o);function k(){for(var P=arguments.length,L=O(P),z=P,$=rs(k);z--;)L[z]=arguments[z];var G=P<3&&L[0]!==$&&L[P-1]!==$?[]:Kn(L,$);if(P-=G.length,P<f)return up(o,c,ul,k.placeholder,n,L,G,n,n,f-P);var J=this&&this!==Te&&this instanceof k?_:o;return Xe(J,this,L)}return k}function op(o){return function(c,f,_){var k=ut(c);if(!nn(c)){var P=pt(f,3);c=Ee(c),f=function(z){return P(k[z],z,k)}}var L=o(c,f,_);return L>-1?k[P?c[L]:L]:n}}function ap(o){return pi(function(c){var f=c.length,_=f,k=Cn.prototype.thru;for(o&&c.reverse();_--;){var P=c[_];if(typeof P!="function")throw new tn(a);if(k&&!L&&pl(P)=="wrapper")var L=new Cn([],!0)}for(_=L?_:f;++_<f;){P=c[_];var z=pl(P),$=z=="wrapper"?lh(P):n;$&&fh($[0])&&$[1]==(I|B|R|j)&&!$[4].length&&$[9]==1?L=L[pl($[0])].apply(L,$[3]):L=P.length==1&&fh(P)?L[z]():L.thru(P)}return function(){var G=arguments,J=G[0];if(L&&G.length==1&&kt(J))return L.plant(J).value();for(var Q=0,at=f?c[Q].apply(this,G):J;++Q<f;)at=c[Q].call(this,at);return at}})}function ul(o,c,f,_,k,P,L,z,$,G){var J=c&I,Q=c&T,at=c&A,ft=c&(B|D),gt=c&q,Et=at?n:lo(o);function mt(){for(var Mt=arguments.length,It=O(Mt),vn=Mt;vn--;)It[vn]=arguments[vn];if(ft)var Ze=rs(mt),bn=Ri(It,Ze);if(_&&(It=ep(It,_,k,ft)),P&&(It=np(It,P,L,ft)),Mt-=bn,ft&&Mt<G){var ge=Kn(It,Ze);return up(o,c,ul,mt.placeholder,f,It,ge,z,$,G-Mt)}var zn=Q?f:this,bi=at?zn[o]:o;return Mt=It.length,z?It=M_(It,z):gt&&Mt>1&&It.reverse(),J&&$<Mt&&(It.length=$),this&&this!==Te&&this instanceof mt&&(bi=Et||lo(bi)),bi.apply(zn,It)}return mt}function lp(o,c){return function(f,_){return H0(f,o,c(_),{})}}function hl(o,c){return function(f,_){var k;if(f===n&&_===n)return c;if(f!==n&&(k=f),_!==n){if(k===n)return _;typeof f=="string"||typeof _=="string"?(f=gn(f),_=gn(_)):(f=Xd(f),_=Xd(_)),k=o(f,_)}return k}}function rh(o){return pi(function(c){return c=Kt(c,Ke(pt())),Pt(function(f){var _=this;return o(c,function(k){return Xe(k,_,f)})})})}function fl(o,c){c=c===n?" ":gn(c);var f=c.length;if(f<2)return f?Ju(c,o):c;var _=Ju(c,Za(o/Li(c)));return Di(c)?Bi(pn(_),0,o).join(""):_.slice(0,o)}function f_(o,c,f,_){var k=c&T,P=lo(o);function L(){for(var z=-1,$=arguments.length,G=-1,J=_.length,Q=O(J+$),at=this&&this!==Te&&this instanceof L?P:o;++G<J;)Q[G]=_[G];for(;$--;)Q[G++]=arguments[++z];return Xe(at,k?f:this,Q)}return L}function cp(o){return function(c,f,_){return _&&typeof _!="number"&&Je(c,f,_)&&(f=_=n),c=vi(c),f===n?(f=c,c=0):f=vi(f),_=_===n?c<f?1:-1:vi(_),J0(c,f,_,o)}}function dl(o){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=En(c),f=En(f)),o(c,f)}}function up(o,c,f,_,k,P,L,z,$,G){var J=c&B,Q=J?L:n,at=J?n:L,ft=J?P:n,gt=J?n:P;c|=J?R:N,c&=~(J?N:R),c&M||(c&=-4);var Et=[o,c,k,ft,Q,gt,at,z,$,G],mt=f.apply(n,Et);return fh(o)&&xp(mt,Et),mt.placeholder=_,Sp(mt,o,c)}function sh(o){var c=nt[o];return function(f,_){if(f=En(f),_=_==null?0:Be(At(_),292),_&&Sd(f)){var k=(Wt(f)+"e").split("e"),P=c(k[0]+"e"+(+k[1]+_));return k=(Wt(P)+"e").split("e"),+(k[0]+"e"+(+k[1]-_))}return c(f)}}var d_=Qr&&1/Kr(new Qr([,-0]))[1]==K?function(o){return new Qr(o)}:kh;function hp(o){return function(c){var f=He(c);return f==re?Vs(c):f==Xt?Mu(c):Cu(c,o(c))}}function di(o,c,f,_,k,P,L,z){var $=c&A;if(!$&&typeof o!="function")throw new tn(a);var G=_?_.length:0;if(G||(c&=-97,_=k=n),L=L===n?L:Ce(At(L),0),z=z===n?z:At(z),G-=k?k.length:0,c&N){var J=_,Q=k;_=k=n}var at=$?n:lh(o),ft=[o,c,f,_,k,J,Q,P,L,z];if(at&&A_(ft,at),o=ft[0],c=ft[1],f=ft[2],_=ft[3],k=ft[4],z=ft[9]=ft[9]===n?$?0:o.length:Ce(ft[9]-G,0),!z&&c&(B|D)&&(c&=-25),!c||c==T)var gt=u_(o,c,f);else c==B||c==D?gt=h_(o,c,z):(c==R||c==(T|R))&&!k.length?gt=f_(o,c,f,_):gt=ul.apply(n,ft);var Et=at?Vd:xp;return Sp(Et(gt,ft),o,c)}function fp(o,c,f,_){return o===n||Hn(o,ci[f])&&!Ht.call(_,f)?c:o}function dp(o,c,f,_,k,P){return se(o)&&se(c)&&(P.set(c,o),ol(o,c,n,dp,P),P.delete(c)),o}function p_(o){return ho(o)?n:o}function pp(o,c,f,_,k,P){var L=f&S,z=o.length,$=c.length;if(z!=$&&!(L&&$>z))return!1;var G=P.get(o),J=P.get(c);if(G&&J)return G==c&&J==o;var Q=-1,at=!0,ft=f&C?new ur:n;for(P.set(o,c),P.set(c,o);++Q<z;){var gt=o[Q],Et=c[Q];if(_)var mt=L?_(Et,gt,Q,c,o,P):_(gt,Et,Q,o,c,P);if(mt!==n){if(mt)continue;at=!1;break}if(ft){if(!Bs(c,function(Mt,It){if(!ir(ft,It)&&(gt===Mt||k(gt,Mt,f,_,P)))return ft.push(It)})){at=!1;break}}else if(!(gt===Et||k(gt,Et,f,_,P))){at=!1;break}}return P.delete(o),P.delete(c),at}function g_(o,c,f,_,k,P,L){switch(f){case Z:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case fe:return!(o.byteLength!=c.byteLength||!P(new Jr(o),new Jr(c)));case Ot:case St:case oe:return Hn(+o,+c);case De:return o.name==c.name&&o.message==c.message;case he:case xe:return o==c+"";case re:var z=Vs;case Xt:var $=_&S;if(z||(z=Kr),o.size!=c.size&&!$)return!1;var G=L.get(o);if(G)return G==c;_|=C,L.set(o,c);var J=pp(z(o),z(c),_,k,P,L);return L.delete(o),J;case Ae:if(eo)return eo.call(o)==eo.call(c)}return!1}function m_(o,c,f,_,k,P){var L=f&S,z=oh(o),$=z.length,G=oh(c),J=G.length;if($!=J&&!L)return!1;for(var Q=$;Q--;){var at=z[Q];if(!(L?at in c:Ht.call(c,at)))return!1}var ft=P.get(o),gt=P.get(c);if(ft&&gt)return ft==c&&gt==o;var Et=!0;P.set(o,c),P.set(c,o);for(var mt=L;++Q<$;){at=z[Q];var Mt=o[at],It=c[at];if(_)var vn=L?_(It,Mt,at,c,o,P):_(Mt,It,at,o,c,P);if(!(vn===n?Mt===It||k(Mt,It,f,_,P):vn)){Et=!1;break}mt||(mt=at=="constructor")}if(Et&&!mt){var Ze=o.constructor,bn=c.constructor;Ze!=bn&&"constructor"in o&&"constructor"in c&&!(typeof Ze=="function"&&Ze instanceof Ze&&typeof bn=="function"&&bn instanceof bn)&&(Et=!1)}return P.delete(o),P.delete(c),Et}function pi(o){return ph(_p(o,n,Ep),o+"")}function oh(o){return Ld(o,Ee,uh)}function ah(o){return Ld(o,rn,gp)}var lh=tl?function(o){return tl.get(o)}:kh;function pl(o){for(var c=o.name+"",f=ts[c],_=Ht.call(ts,c)?f.length:0;_--;){var k=f[_],P=k.func;if(P==null||P==o)return k.name}return c}function rs(o){var c=Ht.call(E,"placeholder")?E:o;return c.placeholder}function pt(){var o=E.iteratee||Ch;return o=o===Ch?Fd:o,arguments.length?o(arguments[0],arguments[1]):o}function gl(o,c){var f=o.__data__;return T_(c)?f[typeof c=="string"?"string":"hash"]:f.map}function ch(o){for(var c=Ee(o),f=c.length;f--;){var _=c[f],k=o[_];c[f]=[_,k,bp(k)]}return c}function dr(o,c){var f=Ua(o,c);return Nd(f)?f:n}function v_(o){var c=Ht.call(o,lr),f=o[lr];try{o[lr]=n;var _=!0}catch{}var k=or.call(o);return _&&(c?o[lr]=f:delete o[lr]),k}var uh=Fu?function(o){return o==null?[]:(o=ut(o),qn(Fu(o),function(c){return wd.call(o,c)}))}:Ah,gp=Fu?function(o){for(var c=[];o;)Xn(c,uh(o)),o=Zr(o);return c}:Ah,He=Ge;(Bu&&He(new Bu(new ArrayBuffer(1)))!=Z||Zs&&He(new Zs)!=re||Hu&&He(Hu.resolve())!=Ve||Qr&&He(new Qr)!=Xt||Qs&&He(new Qs)!=Yt)&&(He=function(o){var c=Ge(o),f=c==ye?o.constructor:n,_=f?pr(f):"";if(_)switch(_){case Qy:return Z;case t0:return re;case e0:return Ve;case n0:return Xt;case i0:return Yt}return c});function b_(o,c,f){for(var _=-1,k=f.length;++_<k;){var P=f[_],L=P.size;switch(P.type){case"drop":o+=L;break;case"dropRight":c-=L;break;case"take":c=Be(c,o+L);break;case"takeRight":o=Ce(o,c-L);break}}return{start:o,end:c}}function y_(o){var c=o.match(ua);return c?c[1].split(ha):[]}function mp(o,c,f){c=Fi(c,o);for(var _=-1,k=c.length,P=!1;++_<k;){var L=Qn(c[_]);if(!(P=o!=null&&f(o,L)))break;o=o[L]}return P||++_!=k?P:(k=o==null?0:o.length,!!k&&xl(k)&&gi(L,k)&&(kt(o)||gr(o)))}function __(o){var c=o.length,f=new o.constructor(c);return c&&typeof o[0]=="string"&&Ht.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function vp(o){return typeof o.constructor=="function"&&!co(o)?es(Zr(o)):{}}function w_(o,c,f){var _=o.constructor;switch(c){case fe:return ih(o);case Ot:case St:return new _(+o);case Z:return r_(o,f);case et:case ht:case lt:case Bt:case jt:case de:case Ie:case qe:case Ne:return Qd(o,f);case re:return new _;case oe:case xe:return new _(o);case he:return s_(o);case Xt:return new _;case Ae:return o_(o)}}function x_(o,c){var f=c.length;if(!f)return o;var _=f-1;return c[_]=(f>1?"& ":"")+c[_],c=c.join(f>2?", ":" "),o.replace(ca,`{
/* [wrapped with `+c+`] */
`)}function S_(o){return kt(o)||gr(o)||!!(xd&&o&&o[xd])}function gi(o,c){var f=typeof o;return c=c??ct,!!c&&(f=="number"||f!="symbol"&&Gc.test(o))&&o>-1&&o%1==0&&o<c}function Je(o,c,f){if(!se(f))return!1;var _=typeof c;return(_=="number"?nn(f)&&gi(c,f.length):_=="string"&&c in f)?Hn(f[c],o):!1}function hh(o,c){if(kt(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||mn(o)?!0:jc.test(o)||!Wc.test(o)||c!=null&&o in ut(c)}function T_(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function fh(o){var c=pl(o),f=E[c];if(typeof f!="function"||!(c in Dt.prototype))return!1;if(o===f)return!0;var _=lh(f);return!!_&&o===_[0]}function C_(o){return!!Xs&&Xs in o}var O_=Gr?mi:Eh;function co(o){var c=o&&o.constructor,f=typeof c=="function"&&c.prototype||ci;return o===f}function bp(o){return o===o&&!se(o)}function yp(o,c){return function(f){return f==null?!1:f[o]===c&&(c!==n||o in ut(f))}}function k_(o){var c=_l(o,function(_){return f.size===h&&f.clear(),_}),f=c.cache;return c}function A_(o,c){var f=o[1],_=c[1],k=f|_,P=k<(T|A|I),L=_==I&&f==B||_==I&&f==j&&o[7].length<=c[8]||_==(I|j)&&c[7].length<=c[8]&&f==B;if(!(P||L))return o;_&T&&(o[2]=c[2],k|=f&T?0:M);var z=c[3];if(z){var $=o[3];o[3]=$?ep($,z,c[4]):z,o[4]=$?Kn(o[3],d):c[4]}return z=c[5],z&&($=o[5],o[5]=$?np($,z,c[6]):z,o[6]=$?Kn(o[5],d):c[6]),z=c[7],z&&(o[7]=z),_&I&&(o[8]=o[8]==null?c[8]:Be(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=k,o}function E_(o){var c=[];if(o!=null)for(var f in ut(o))c.push(f);return c}function P_(o){return or.call(o)}function _p(o,c,f){return c=Ce(c===n?o.length-1:c,0),function(){for(var _=arguments,k=-1,P=Ce(_.length-c,0),L=O(P);++k<P;)L[k]=_[c+k];k=-1;for(var z=O(c+1);++k<c;)z[k]=_[k];return z[c]=f(L),Xe(o,this,z)}}function wp(o,c){return c.length<2?o:fr(o,kn(c,0,-1))}function M_(o,c){for(var f=o.length,_=Be(c.length,f),k=en(o);_--;){var P=c[_];o[_]=gi(P,f)?k[P]:n}return o}function dh(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var xp=Tp(Vd),uo=qy||function(o,c){return Te.setTimeout(o,c)},ph=Tp(t_);function Sp(o,c,f){var _=c+"";return ph(o,x_(_,R_(y_(_),f)))}function Tp(o){var c=0,f=0;return function(){var _=Gy(),k=V-(_-f);if(f=_,k>0){if(++c>=U)return arguments[0]}else c=0;return o.apply(n,arguments)}}function ml(o,c){var f=-1,_=o.length,k=_-1;for(c=c===n?_:c;++f<c;){var P=Gu(f,k),L=o[P];o[P]=o[f],o[f]=L}return o.length=c,o}var Cp=k_(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace($c,function(f,_,k,P){c.push(k?P.replace(qc,"$1"):_||f)}),c});function Qn(o){if(typeof o=="string"||mn(o))return o;var c=o+"";return c=="0"&&1/o==-K?"-0":c}function pr(o){if(o!=null){try{return sr.call(o)}catch{}try{return o+""}catch{}}return""}function R_(o,c){return Ye(xt,function(f){var _="_."+f[0];c&f[1]&&!Xr(o,_)&&o.push(_)}),o.sort()}function Op(o){if(o instanceof Dt)return o.clone();var c=new Cn(o.__wrapped__,o.__chain__);return c.__actions__=en(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function D_(o,c,f){(f?Je(o,c,f):c===n)?c=1:c=Ce(At(c),0);var _=o==null?0:o.length;if(!_||c<1)return[];for(var k=0,P=0,L=O(Za(_/c));k<_;)L[P++]=kn(o,k,k+=c);return L}function L_(o){for(var c=-1,f=o==null?0:o.length,_=0,k=[];++c<f;){var P=o[c];P&&(k[_++]=P)}return k}function I_(){var o=arguments.length;if(!o)return[];for(var c=O(o-1),f=arguments[0],_=o;_--;)c[_-1]=arguments[_];return Xn(kt(f)?en(f):[f],Fe(c,1))}var N_=Pt(function(o,c){return pe(o)?ro(o,Fe(c,1,pe,!0)):[]}),F_=Pt(function(o,c){var f=An(c);return pe(f)&&(f=n),pe(o)?ro(o,Fe(c,1,pe,!0),pt(f,2)):[]}),B_=Pt(function(o,c){var f=An(c);return pe(f)&&(f=n),pe(o)?ro(o,Fe(c,1,pe,!0),n,f):[]});function H_(o,c,f){var _=o==null?0:o.length;return _?(c=f||c===n?1:At(c),kn(o,c<0?0:c,_)):[]}function z_(o,c,f){var _=o==null?0:o.length;return _?(c=f||c===n?1:At(c),c=_-c,kn(o,0,c<0?0:c)):[]}function W_(o,c){return o&&o.length?ll(o,pt(c,3),!0,!0):[]}function j_(o,c){return o&&o.length?ll(o,pt(c,3),!0):[]}function $_(o,c,f,_){var k=o==null?0:o.length;return k?(f&&typeof f!="number"&&Je(o,c,f)&&(f=0,_=k),I0(o,c,f,_)):[]}function kp(o,c,f){var _=o==null?0:o.length;if(!_)return-1;var k=f==null?0:At(f);return k<0&&(k=Ce(_+k,0)),yt(o,pt(c,3),k)}function Ap(o,c,f){var _=o==null?0:o.length;if(!_)return-1;var k=_-1;return f!==n&&(k=At(f),k=f<0?Ce(_+k,0):Be(k,_-1)),yt(o,pt(c,3),k,!0)}function Ep(o){var c=o==null?0:o.length;return c?Fe(o,1):[]}function U_(o){var c=o==null?0:o.length;return c?Fe(o,K):[]}function V_(o,c){var f=o==null?0:o.length;return f?(c=c===n?1:At(c),Fe(o,c)):[]}function q_(o){for(var c=-1,f=o==null?0:o.length,_={};++c<f;){var k=o[c];_[k[0]]=k[1]}return _}function Pp(o){return o&&o.length?o[0]:n}function X_(o,c,f){var _=o==null?0:o.length;if(!_)return-1;var k=f==null?0:At(f);return k<0&&(k=Ce(_+k,0)),Yn(o,c,k)}function Y_(o){var c=o==null?0:o.length;return c?kn(o,0,-1):[]}var K_=Pt(function(o){var c=Kt(o,eh);return c.length&&c[0]===o[0]?Vu(c):[]}),G_=Pt(function(o){var c=An(o),f=Kt(o,eh);return c===An(f)?c=n:f.pop(),f.length&&f[0]===o[0]?Vu(f,pt(c,2)):[]}),J_=Pt(function(o){var c=An(o),f=Kt(o,eh);return c=typeof c=="function"?c:n,c&&f.pop(),f.length&&f[0]===o[0]?Vu(f,n,c):[]});function Z_(o,c){return o==null?"":Yy.call(o,c)}function An(o){var c=o==null?0:o.length;return c?o[c-1]:n}function Q_(o,c,f){var _=o==null?0:o.length;if(!_)return-1;var k=_;return f!==n&&(k=At(f),k=k<0?Ce(_+k,0):Be(k,_-1)),c===c?Du(o,c,k):yt(o,Ha,k,!0)}function tw(o,c){return o&&o.length?Wd(o,At(c)):n}var ew=Pt(Mp);function Mp(o,c){return o&&o.length&&c&&c.length?Ku(o,c):o}function nw(o,c,f){return o&&o.length&&c&&c.length?Ku(o,c,pt(f,2)):o}function iw(o,c,f){return o&&o.length&&c&&c.length?Ku(o,c,n,f):o}var rw=pi(function(o,c){var f=o==null?0:o.length,_=Wu(o,c);return Ud(o,Kt(c,function(k){return gi(k,f)?+k:k}).sort(tp)),_});function sw(o,c){var f=[];if(!(o&&o.length))return f;var _=-1,k=[],P=o.length;for(c=pt(c,3);++_<P;){var L=o[_];c(L,_,o)&&(f.push(L),k.push(_))}return Ud(o,k),f}function gh(o){return o==null?o:Zy.call(o)}function ow(o,c,f){var _=o==null?0:o.length;return _?(f&&typeof f!="number"&&Je(o,c,f)?(c=0,f=_):(c=c==null?0:At(c),f=f===n?_:At(f)),kn(o,c,f)):[]}function aw(o,c){return al(o,c)}function lw(o,c,f){return Zu(o,c,pt(f,2))}function cw(o,c){var f=o==null?0:o.length;if(f){var _=al(o,c);if(_<f&&Hn(o[_],c))return _}return-1}function uw(o,c){return al(o,c,!0)}function hw(o,c,f){return Zu(o,c,pt(f,2),!0)}function fw(o,c){var f=o==null?0:o.length;if(f){var _=al(o,c,!0)-1;if(Hn(o[_],c))return _}return-1}function dw(o){return o&&o.length?qd(o):[]}function pw(o,c){return o&&o.length?qd(o,pt(c,2)):[]}function gw(o){var c=o==null?0:o.length;return c?kn(o,1,c):[]}function mw(o,c,f){return o&&o.length?(c=f||c===n?1:At(c),kn(o,0,c<0?0:c)):[]}function vw(o,c,f){var _=o==null?0:o.length;return _?(c=f||c===n?1:At(c),c=_-c,kn(o,c<0?0:c,_)):[]}function bw(o,c){return o&&o.length?ll(o,pt(c,3),!1,!0):[]}function yw(o,c){return o&&o.length?ll(o,pt(c,3)):[]}var _w=Pt(function(o){return Ni(Fe(o,1,pe,!0))}),ww=Pt(function(o){var c=An(o);return pe(c)&&(c=n),Ni(Fe(o,1,pe,!0),pt(c,2))}),xw=Pt(function(o){var c=An(o);return c=typeof c=="function"?c:n,Ni(Fe(o,1,pe,!0),n,c)});function Sw(o){return o&&o.length?Ni(o):[]}function Tw(o,c){return o&&o.length?Ni(o,pt(c,2)):[]}function Cw(o,c){return c=typeof c=="function"?c:n,o&&o.length?Ni(o,n,c):[]}function mh(o){if(!(o&&o.length))return[];var c=0;return o=qn(o,function(f){if(pe(f))return c=Ce(f.length,c),!0}),$s(c,function(f){return Kt(o,Hs(f))})}function Rp(o,c){if(!(o&&o.length))return[];var f=mh(o);return c==null?f:Kt(f,function(_){return Xe(c,n,_)})}var Ow=Pt(function(o,c){return pe(o)?ro(o,c):[]}),kw=Pt(function(o){return th(qn(o,pe))}),Aw=Pt(function(o){var c=An(o);return pe(c)&&(c=n),th(qn(o,pe),pt(c,2))}),Ew=Pt(function(o){var c=An(o);return c=typeof c=="function"?c:n,th(qn(o,pe),n,c)}),Pw=Pt(mh);function Mw(o,c){return Gd(o||[],c||[],no)}function Rw(o,c){return Gd(o||[],c||[],ao)}var Dw=Pt(function(o){var c=o.length,f=c>1?o[c-1]:n;return f=typeof f=="function"?(o.pop(),f):n,Rp(o,f)});function Dp(o){var c=E(o);return c.__chain__=!0,c}function Lw(o,c){return c(o),o}function vl(o,c){return c(o)}var Iw=pi(function(o){var c=o.length,f=c?o[0]:0,_=this.__wrapped__,k=function(P){return Wu(P,o)};return c>1||this.__actions__.length||!(_ instanceof Dt)||!gi(f)?this.thru(k):(_=_.slice(f,+f+(c?1:0)),_.__actions__.push({func:vl,args:[k],thisArg:n}),new Cn(_,this.__chain__).thru(function(P){return c&&!P.length&&P.push(n),P}))});function Nw(){return Dp(this)}function Fw(){return new Cn(this.value(),this.__chain__)}function Bw(){this.__values__===n&&(this.__values__=Xp(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function Hw(){return this}function zw(o){for(var c,f=this;f instanceof nl;){var _=Op(f);_.__index__=0,_.__values__=n,c?k.__wrapped__=_:c=_;var k=_;f=f.__wrapped__}return k.__wrapped__=o,c}function Ww(){var o=this.__wrapped__;if(o instanceof Dt){var c=o;return this.__actions__.length&&(c=new Dt(this)),c=c.reverse(),c.__actions__.push({func:vl,args:[gh],thisArg:n}),new Cn(c,this.__chain__)}return this.thru(gh)}function jw(){return Kd(this.__wrapped__,this.__actions__)}var $w=cl(function(o,c,f){Ht.call(o,f)?++o[f]:fi(o,f,1)});function Uw(o,c,f){var _=kt(o)?Is:L0;return f&&Je(o,c,f)&&(c=n),_(o,pt(c,3))}function Vw(o,c){var f=kt(o)?qn:Rd;return f(o,pt(c,3))}var qw=op(kp),Xw=op(Ap);function Yw(o,c){return Fe(bl(o,c),1)}function Kw(o,c){return Fe(bl(o,c),K)}function Gw(o,c,f){return f=f===n?1:At(f),Fe(bl(o,c),f)}function Lp(o,c){var f=kt(o)?Ye:Ii;return f(o,pt(c,3))}function Ip(o,c){var f=kt(o)?_u:Md;return f(o,pt(c,3))}var Jw=cl(function(o,c,f){Ht.call(o,f)?o[f].push(c):fi(o,f,[c])});function Zw(o,c,f,_){o=nn(o)?o:os(o),f=f&&!_?At(f):0;var k=o.length;return f<0&&(f=Ce(k+f,0)),Sl(o)?f<=k&&o.indexOf(c,f)>-1:!!k&&Yn(o,c,f)>-1}var Qw=Pt(function(o,c,f){var _=-1,k=typeof c=="function",P=nn(o)?O(o.length):[];return Ii(o,function(L){P[++_]=k?Xe(c,L,f):so(L,c,f)}),P}),tx=cl(function(o,c,f){fi(o,f,c)});function bl(o,c){var f=kt(o)?Kt:Bd;return f(o,pt(c,3))}function ex(o,c,f,_){return o==null?[]:(kt(c)||(c=c==null?[]:[c]),f=_?n:f,kt(f)||(f=f==null?[]:[f]),jd(o,c,f))}var nx=cl(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function ix(o,c,f){var _=kt(o)?Fs:Ws,k=arguments.length<3;return _(o,pt(c,4),f,k,Ii)}function rx(o,c,f){var _=kt(o)?wu:Ws,k=arguments.length<3;return _(o,pt(c,4),f,k,Md)}function sx(o,c){var f=kt(o)?qn:Rd;return f(o,wl(pt(c,3)))}function ox(o){var c=kt(o)?kd:Z0;return c(o)}function ax(o,c,f){(f?Je(o,c,f):c===n)?c=1:c=At(c);var _=kt(o)?E0:Q0;return _(o,c)}function lx(o){var c=kt(o)?P0:e_;return c(o)}function cx(o){if(o==null)return 0;if(nn(o))return Sl(o)?Li(o):o.length;var c=He(o);return c==re||c==Xt?o.size:Xu(o).length}function ux(o,c,f){var _=kt(o)?Bs:n_;return f&&Je(o,c,f)&&(c=n),_(o,pt(c,3))}var hx=Pt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Je(o,c[0],c[1])?c=[]:f>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),jd(o,Fe(c,1),[])}),yl=Vy||function(){return Te.Date.now()};function fx(o,c){if(typeof c!="function")throw new tn(a);return o=At(o),function(){if(--o<1)return c.apply(this,arguments)}}function Np(o,c,f){return c=f?n:c,c=o&&c==null?o.length:c,di(o,I,n,n,n,n,c)}function Fp(o,c){var f;if(typeof c!="function")throw new tn(a);return o=At(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=n),f}}var vh=Pt(function(o,c,f){var _=T;if(f.length){var k=Kn(f,rs(vh));_|=R}return di(o,_,c,f,k)}),Bp=Pt(function(o,c,f){var _=T|A;if(f.length){var k=Kn(f,rs(Bp));_|=R}return di(c,_,o,f,k)});function Hp(o,c,f){c=f?n:c;var _=di(o,B,n,n,n,n,n,c);return _.placeholder=Hp.placeholder,_}function zp(o,c,f){c=f?n:c;var _=di(o,D,n,n,n,n,n,c);return _.placeholder=zp.placeholder,_}function Wp(o,c,f){var _,k,P,L,z,$,G=0,J=!1,Q=!1,at=!0;if(typeof o!="function")throw new tn(a);c=En(c)||0,se(f)&&(J=!!f.leading,Q="maxWait"in f,P=Q?Ce(En(f.maxWait)||0,c):P,at="trailing"in f?!!f.trailing:at);function ft(ge){var zn=_,bi=k;return _=k=n,G=ge,L=o.apply(bi,zn),L}function gt(ge){return G=ge,z=uo(Mt,c),J?ft(ge):L}function Et(ge){var zn=ge-$,bi=ge-G,og=c-zn;return Q?Be(og,P-bi):og}function mt(ge){var zn=ge-$,bi=ge-G;return $===n||zn>=c||zn<0||Q&&bi>=P}function Mt(){var ge=yl();if(mt(ge))return It(ge);z=uo(Mt,Et(ge))}function It(ge){return z=n,at&&_?ft(ge):(_=k=n,L)}function vn(){z!==n&&Jd(z),G=0,_=$=k=z=n}function Ze(){return z===n?L:It(yl())}function bn(){var ge=yl(),zn=mt(ge);if(_=arguments,k=this,$=ge,zn){if(z===n)return gt($);if(Q)return Jd(z),z=uo(Mt,c),ft($)}return z===n&&(z=uo(Mt,c)),L}return bn.cancel=vn,bn.flush=Ze,bn}var dx=Pt(function(o,c){return Pd(o,1,c)}),px=Pt(function(o,c,f){return Pd(o,En(c)||0,f)});function gx(o){return di(o,q)}function _l(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new tn(a);var f=function(){var _=arguments,k=c?c.apply(this,_):_[0],P=f.cache;if(P.has(k))return P.get(k);var L=o.apply(this,_);return f.cache=P.set(k,L)||P,L};return f.cache=new(_l.Cache||hi),f}_l.Cache=hi;function wl(o){if(typeof o!="function")throw new tn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function mx(o){return Fp(2,o)}var vx=i_(function(o,c){c=c.length==1&&kt(c[0])?Kt(c[0],Ke(pt())):Kt(Fe(c,1),Ke(pt()));var f=c.length;return Pt(function(_){for(var k=-1,P=Be(_.length,f);++k<P;)_[k]=c[k].call(this,_[k]);return Xe(o,this,_)})}),bh=Pt(function(o,c){var f=Kn(c,rs(bh));return di(o,R,n,c,f)}),jp=Pt(function(o,c){var f=Kn(c,rs(jp));return di(o,N,n,c,f)}),bx=pi(function(o,c){return di(o,j,n,n,n,c)});function yx(o,c){if(typeof o!="function")throw new tn(a);return c=c===n?c:At(c),Pt(o,c)}function _x(o,c){if(typeof o!="function")throw new tn(a);return c=c==null?0:Ce(At(c),0),Pt(function(f){var _=f[c],k=Bi(f,0,c);return _&&Xn(k,_),Xe(o,this,k)})}function wx(o,c,f){var _=!0,k=!0;if(typeof o!="function")throw new tn(a);return se(f)&&(_="leading"in f?!!f.leading:_,k="trailing"in f?!!f.trailing:k),Wp(o,c,{leading:_,maxWait:c,trailing:k})}function xx(o){return Np(o,1)}function Sx(o,c){return bh(nh(c),o)}function Tx(){if(!arguments.length)return[];var o=arguments[0];return kt(o)?o:[o]}function Cx(o){return On(o,x)}function Ox(o,c){return c=typeof c=="function"?c:n,On(o,x,c)}function kx(o){return On(o,m|x)}function Ax(o,c){return c=typeof c=="function"?c:n,On(o,m|x,c)}function Ex(o,c){return c==null||Ed(o,c,Ee(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var Px=dl(Uu),Mx=dl(function(o,c){return o>=c}),gr=Id(function(){return arguments}())?Id:function(o){return ae(o)&&Ht.call(o,"callee")&&!wd.call(o,"callee")},kt=O.isArray,Rx=Da?Ke(Da):z0;function nn(o){return o!=null&&xl(o.length)&&!mi(o)}function pe(o){return ae(o)&&nn(o)}function Dx(o){return o===!0||o===!1||ae(o)&&Ge(o)==Ot}var Hi=Xy||Eh,Lx=La?Ke(La):W0;function Ix(o){return ae(o)&&o.nodeType===1&&!ho(o)}function Nx(o){if(o==null)return!0;if(nn(o)&&(kt(o)||typeof o=="string"||typeof o.splice=="function"||Hi(o)||ss(o)||gr(o)))return!o.length;var c=He(o);if(c==re||c==Xt)return!o.size;if(co(o))return!Xu(o).length;for(var f in o)if(Ht.call(o,f))return!1;return!0}function Fx(o,c){return oo(o,c)}function Bx(o,c,f){f=typeof f=="function"?f:n;var _=f?f(o,c):n;return _===n?oo(o,c,n,f):!!_}function yh(o){if(!ae(o))return!1;var c=Ge(o);return c==De||c==In||typeof o.message=="string"&&typeof o.name=="string"&&!ho(o)}function Hx(o){return typeof o=="number"&&Sd(o)}function mi(o){if(!se(o))return!1;var c=Ge(o);return c==te||c==Le||c==be||c==wn}function $p(o){return typeof o=="number"&&o==At(o)}function xl(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=ct}function se(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ae(o){return o!=null&&typeof o=="object"}var Up=qr?Ke(qr):$0;function zx(o,c){return o===c||qu(o,c,ch(c))}function Wx(o,c,f){return f=typeof f=="function"?f:n,qu(o,c,ch(c),f)}function jx(o){return Vp(o)&&o!=+o}function $x(o){if(O_(o))throw new Y(s);return Nd(o)}function Ux(o){return o===null}function Vx(o){return o==null}function Vp(o){return typeof o=="number"||ae(o)&&Ge(o)==oe}function ho(o){if(!ae(o)||Ge(o)!=ye)return!1;var c=Zr(o);if(c===null)return!0;var f=Ht.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&sr.call(f)==Ya}var _h=Vn?Ke(Vn):U0;function qx(o){return $p(o)&&o>=-ct&&o<=ct}var qp=Ia?Ke(Ia):V0;function Sl(o){return typeof o=="string"||!kt(o)&&ae(o)&&Ge(o)==xe}function mn(o){return typeof o=="symbol"||ae(o)&&Ge(o)==Ae}var ss=Na?Ke(Na):q0;function Xx(o){return o===n}function Yx(o){return ae(o)&&He(o)==Yt}function Kx(o){return ae(o)&&Ge(o)==Se}var Gx=dl(Yu),Jx=dl(function(o,c){return o<=c});function Xp(o){if(!o)return[];if(nn(o))return Sl(o)?pn(o):en(o);if(Js&&o[Js])return Pu(o[Js]());var c=He(o),f=c==re?Vs:c==Xt?Kr:os;return f(o)}function vi(o){if(!o)return o===0?o:0;if(o=En(o),o===K||o===-K){var c=o<0?-1:1;return c*dt}return o===o?o:0}function At(o){var c=vi(o),f=c%1;return c===c?f?c-f:c:0}function Yp(o){return o?hr(At(o),0,wt):0}function En(o){if(typeof o=="number")return o;if(mn(o))return _t;if(se(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=se(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=Wa(o);var f=Xc.test(o);return f||Kc.test(o)?vu(o.slice(2),f?2:8):da.test(o)?_t:+o}function Kp(o){return Zn(o,rn(o))}function Zx(o){return o?hr(At(o),-ct,ct):o===0?o:0}function Wt(o){return o==null?"":gn(o)}var Qx=ns(function(o,c){if(co(c)||nn(c)){Zn(c,Ee(c),o);return}for(var f in c)Ht.call(c,f)&&no(o,f,c[f])}),Gp=ns(function(o,c){Zn(c,rn(c),o)}),Tl=ns(function(o,c,f,_){Zn(c,rn(c),o,_)}),tS=ns(function(o,c,f,_){Zn(c,Ee(c),o,_)}),eS=pi(Wu);function nS(o,c){var f=es(o);return c==null?f:Ad(f,c)}var iS=Pt(function(o,c){o=ut(o);var f=-1,_=c.length,k=_>2?c[2]:n;for(k&&Je(c[0],c[1],k)&&(_=1);++f<_;)for(var P=c[f],L=rn(P),z=-1,$=L.length;++z<$;){var G=L[z],J=o[G];(J===n||Hn(J,ci[G])&&!Ht.call(o,G))&&(o[G]=P[G])}return o}),rS=Pt(function(o){return o.push(n,dp),Xe(Jp,n,o)});function sS(o,c){return Ba(o,pt(c,3),Jn)}function oS(o,c){return Ba(o,pt(c,3),$u)}function aS(o,c){return o==null?o:ju(o,pt(c,3),rn)}function lS(o,c){return o==null?o:Dd(o,pt(c,3),rn)}function cS(o,c){return o&&Jn(o,pt(c,3))}function uS(o,c){return o&&$u(o,pt(c,3))}function hS(o){return o==null?[]:sl(o,Ee(o))}function fS(o){return o==null?[]:sl(o,rn(o))}function wh(o,c,f){var _=o==null?n:fr(o,c);return _===n?f:_}function dS(o,c){return o!=null&&mp(o,c,N0)}function xh(o,c){return o!=null&&mp(o,c,F0)}var pS=lp(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=or.call(c)),o[c]=f},Th(sn)),gS=lp(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=or.call(c)),Ht.call(o,c)?o[c].push(f):o[c]=[f]},pt),mS=Pt(so);function Ee(o){return nn(o)?Od(o):Xu(o)}function rn(o){return nn(o)?Od(o,!0):X0(o)}function vS(o,c){var f={};return c=pt(c,3),Jn(o,function(_,k,P){fi(f,c(_,k,P),_)}),f}function bS(o,c){var f={};return c=pt(c,3),Jn(o,function(_,k,P){fi(f,k,c(_,k,P))}),f}var yS=ns(function(o,c,f){ol(o,c,f)}),Jp=ns(function(o,c,f,_){ol(o,c,f,_)}),_S=pi(function(o,c){var f={};if(o==null)return f;var _=!1;c=Kt(c,function(P){return P=Fi(P,o),_||(_=P.length>1),P}),Zn(o,ah(o),f),_&&(f=On(f,m|y|x,p_));for(var k=c.length;k--;)Qu(f,c[k]);return f});function wS(o,c){return Zp(o,wl(pt(c)))}var xS=pi(function(o,c){return o==null?{}:K0(o,c)});function Zp(o,c){if(o==null)return{};var f=Kt(ah(o),function(_){return[_]});return c=pt(c),$d(o,f,function(_,k){return c(_,k[0])})}function SS(o,c,f){c=Fi(c,o);var _=-1,k=c.length;for(k||(k=1,o=n);++_<k;){var P=o==null?n:o[Qn(c[_])];P===n&&(_=k,P=f),o=mi(P)?P.call(o):P}return o}function TS(o,c,f){return o==null?o:ao(o,c,f)}function CS(o,c,f,_){return _=typeof _=="function"?_:n,o==null?o:ao(o,c,f,_)}var Qp=hp(Ee),tg=hp(rn);function OS(o,c,f){var _=kt(o),k=_||Hi(o)||ss(o);if(c=pt(c,4),f==null){var P=o&&o.constructor;k?f=_?new P:[]:se(o)?f=mi(P)?es(Zr(o)):{}:f={}}return(k?Ye:Jn)(o,function(L,z,$){return c(f,L,z,$)}),f}function kS(o,c){return o==null?!0:Qu(o,c)}function AS(o,c,f){return o==null?o:Yd(o,c,nh(f))}function ES(o,c,f,_){return _=typeof _=="function"?_:n,o==null?o:Yd(o,c,nh(f),_)}function os(o){return o==null?[]:Us(o,Ee(o))}function PS(o){return o==null?[]:Us(o,rn(o))}function MS(o,c,f){return f===n&&(f=c,c=n),f!==n&&(f=En(f),f=f===f?f:0),c!==n&&(c=En(c),c=c===c?c:0),hr(En(o),c,f)}function RS(o,c,f){return c=vi(c),f===n?(f=c,c=0):f=vi(f),o=En(o),B0(o,c,f)}function DS(o,c,f){if(f&&typeof f!="boolean"&&Je(o,c,f)&&(c=f=n),f===n&&(typeof c=="boolean"?(f=c,c=n):typeof o=="boolean"&&(f=o,o=n)),o===n&&c===n?(o=0,c=1):(o=vi(o),c===n?(c=o,o=0):c=vi(c)),o>c){var _=o;o=c,c=_}if(f||o%1||c%1){var k=Td();return Be(o+k*(c-o+mu("1e-"+((k+"").length-1))),c)}return Gu(o,c)}var LS=is(function(o,c,f){return c=c.toLowerCase(),o+(f?eg(c):c)});function eg(o){return Sh(Wt(o).toLowerCase())}function ng(o){return o=Wt(o),o&&o.replace(Jc,Ou).replace(cu,"")}function IS(o,c,f){o=Wt(o),c=gn(c);var _=o.length;f=f===n?_:hr(At(f),0,_);var k=f;return f-=c.length,f>=0&&o.slice(f,k)==c}function NS(o){return o=Wt(o),o&&Nn.test(o)?o.replace(Fr,ku):o}function FS(o){return o=Wt(o),o&&Ei.test(o)?o.replace(Ss,"\\$&"):o}var BS=is(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),HS=is(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),zS=sp("toLowerCase");function WS(o,c,f){o=Wt(o),c=At(c);var _=c?Li(o):0;if(!c||_>=c)return o;var k=(c-_)/2;return fl(Qa(k),f)+o+fl(Za(k),f)}function jS(o,c,f){o=Wt(o),c=At(c);var _=c?Li(o):0;return c&&_<c?o+fl(c-_,f):o}function $S(o,c,f){o=Wt(o),c=At(c);var _=c?Li(o):0;return c&&_<c?fl(c-_,f)+o:o}function US(o,c,f){return f||c==null?c=0:c&&(c=+c),Jy(Wt(o).replace(Ts,""),c||0)}function VS(o,c,f){return(f?Je(o,c,f):c===n)?c=1:c=At(c),Ju(Wt(o),c)}function qS(){var o=arguments,c=Wt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var XS=is(function(o,c,f){return o+(f?"_":"")+c.toLowerCase()});function YS(o,c,f){return f&&typeof f!="number"&&Je(o,c,f)&&(c=f=n),f=f===n?wt:f>>>0,f?(o=Wt(o),o&&(typeof c=="string"||c!=null&&!_h(c))&&(c=gn(c),!c&&Di(o))?Bi(pn(o),0,f):o.split(c,f)):[]}var KS=is(function(o,c,f){return o+(f?" ":"")+Sh(c)});function GS(o,c,f){return o=Wt(o),f=f==null?0:hr(At(f),0,o.length),c=gn(c),o.slice(f,f+c.length)==c}function JS(o,c,f){var _=E.templateSettings;f&&Je(o,c,f)&&(c=n),o=Wt(o),c=Tl({},c,_,fp);var k=Tl({},c.imports,_.imports,fp),P=Ee(k),L=Us(k,P),z,$,G=0,J=c.interpolate||zr,Q="__p += '",at=ee((c.escape||zr).source+"|"+J.source+"|"+(J===Sn?Hr:zr).source+"|"+(c.evaluate||zr).source+"|$","g"),ft="//# sourceURL="+(Ht.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++du+"]")+`
`;o.replace(at,function(mt,Mt,It,vn,Ze,bn){return It||(It=vn),Q+=o.slice(G,bn).replace(Zc,Au),Mt&&(z=!0,Q+=`' +
__e(`+Mt+`) +
'`),Ze&&($=!0,Q+=`';
`+Ze+`;
__p += '`),It&&(Q+=`' +
((__t = (`+It+`)) == null ? '' : __t) +
'`),G=bn+mt.length,mt}),Q+=`';
`;var gt=Ht.call(c,"variable")&&c.variable;if(!gt)Q=`with (obj) {
`+Q+`
}
`;else if(Vc.test(gt))throw new Y(l);Q=($?Q.replace(Zi,""):Q).replace(Qi,"$1").replace(tr,"$1;"),Q="function("+(gt||"obj")+`) {
`+(gt?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(z?", __e = _.escape":"")+($?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Q+`return __p
}`;var Et=rg(function(){return rt(P,ft+"return "+Q).apply(n,L)});if(Et.source=Q,yh(Et))throw Et;return Et}function ZS(o){return Wt(o).toLowerCase()}function QS(o){return Wt(o).toUpperCase()}function tT(o,c,f){if(o=Wt(o),o&&(f||c===n))return Wa(o);if(!o||!(c=gn(c)))return o;var _=pn(o),k=pn(c),P=ja(_,k),L=$a(_,k)+1;return Bi(_,P,L).join("")}function eT(o,c,f){if(o=Wt(o),o&&(f||c===n))return o.slice(0,qa(o)+1);if(!o||!(c=gn(c)))return o;var _=pn(o),k=$a(_,pn(c))+1;return Bi(_,0,k).join("")}function nT(o,c,f){if(o=Wt(o),o&&(f||c===n))return o.replace(Ts,"");if(!o||!(c=gn(c)))return o;var _=pn(o),k=ja(_,pn(c));return Bi(_,k).join("")}function iT(o,c){var f=F,_=H;if(se(c)){var k="separator"in c?c.separator:k;f="length"in c?At(c.length):f,_="omission"in c?gn(c.omission):_}o=Wt(o);var P=o.length;if(Di(o)){var L=pn(o);P=L.length}if(f>=P)return o;var z=f-Li(_);if(z<1)return _;var $=L?Bi(L,0,z).join(""):o.slice(0,z);if(k===n)return $+_;if(L&&(z+=$.length-z),_h(k)){if(o.slice(z).search(k)){var G,J=$;for(k.global||(k=ee(k.source,Wt(fa.exec(k))+"g")),k.lastIndex=0;G=k.exec(J);)var Q=G.index;$=$.slice(0,Q===n?z:Q)}}else if(o.indexOf(gn(k),z)!=z){var at=$.lastIndexOf(k);at>-1&&($=$.slice(0,at))}return $+_}function rT(o){return o=Wt(o),o&&Br.test(o)?o.replace(er,Xa):o}var sT=is(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),Sh=sp("toUpperCase");function ig(o,c,f){return o=Wt(o),c=f?n:c,c===n?Eu(o)?v(o):Su(o):o.match(c)||[]}var rg=Pt(function(o,c){try{return Xe(o,n,c)}catch(f){return yh(f)?f:new Y(f)}}),oT=pi(function(o,c){return Ye(c,function(f){f=Qn(f),fi(o,f,vh(o[f],o))}),o});function aT(o){var c=o==null?0:o.length,f=pt();return o=c?Kt(o,function(_){if(typeof _[1]!="function")throw new tn(a);return[f(_[0]),_[1]]}):[],Pt(function(_){for(var k=-1;++k<c;){var P=o[k];if(Xe(P[0],this,_))return Xe(P[1],this,_)}})}function lT(o){return D0(On(o,m))}function Th(o){return function(){return o}}function cT(o,c){return o==null||o!==o?c:o}var uT=ap(),hT=ap(!0);function sn(o){return o}function Ch(o){return Fd(typeof o=="function"?o:On(o,m))}function fT(o){return Hd(On(o,m))}function dT(o,c){return zd(o,On(c,m))}var pT=Pt(function(o,c){return function(f){return so(f,o,c)}}),gT=Pt(function(o,c){return function(f){return so(o,f,c)}});function Oh(o,c,f){var _=Ee(c),k=sl(c,_);f==null&&!(se(c)&&(k.length||!_.length))&&(f=c,c=o,o=this,k=sl(c,Ee(c)));var P=!(se(f)&&"chain"in f)||!!f.chain,L=mi(o);return Ye(k,function(z){var $=c[z];o[z]=$,L&&(o.prototype[z]=function(){var G=this.__chain__;if(P||G){var J=o(this.__wrapped__),Q=J.__actions__=en(this.__actions__);return Q.push({func:$,args:arguments,thisArg:o}),J.__chain__=G,J}return $.apply(o,Xn([this.value()],arguments))})}),o}function mT(){return Te._===this&&(Te._=Ys),this}function kh(){}function vT(o){return o=At(o),Pt(function(c){return Wd(c,o)})}var bT=rh(Kt),yT=rh(Is),_T=rh(Bs);function sg(o){return hh(o)?Hs(Qn(o)):G0(o)}function wT(o){return function(c){return o==null?n:fr(o,c)}}var xT=cp(),ST=cp(!0);function Ah(){return[]}function Eh(){return!1}function TT(){return{}}function CT(){return""}function OT(){return!0}function kT(o,c){if(o=At(o),o<1||o>ct)return[];var f=wt,_=Be(o,wt);c=pt(c),o-=wt;for(var k=$s(_,c);++f<o;)c(f);return k}function AT(o){return kt(o)?Kt(o,Qn):mn(o)?[o]:en(Cp(Wt(o)))}function ET(o){var c=++Nu;return Wt(o)+c}var PT=hl(function(o,c){return o+c},0),MT=sh("ceil"),RT=hl(function(o,c){return o/c},1),DT=sh("floor");function LT(o){return o&&o.length?rl(o,sn,Uu):n}function IT(o,c){return o&&o.length?rl(o,pt(c,2),Uu):n}function NT(o){return za(o,sn)}function FT(o,c){return za(o,pt(c,2))}function BT(o){return o&&o.length?rl(o,sn,Yu):n}function HT(o,c){return o&&o.length?rl(o,pt(c,2),Yu):n}var zT=hl(function(o,c){return o*c},1),WT=sh("round"),jT=hl(function(o,c){return o-c},0);function $T(o){return o&&o.length?js(o,sn):0}function UT(o,c){return o&&o.length?js(o,pt(c,2)):0}return E.after=fx,E.ary=Np,E.assign=Qx,E.assignIn=Gp,E.assignInWith=Tl,E.assignWith=tS,E.at=eS,E.before=Fp,E.bind=vh,E.bindAll=oT,E.bindKey=Bp,E.castArray=Tx,E.chain=Dp,E.chunk=D_,E.compact=L_,E.concat=I_,E.cond=aT,E.conforms=lT,E.constant=Th,E.countBy=$w,E.create=nS,E.curry=Hp,E.curryRight=zp,E.debounce=Wp,E.defaults=iS,E.defaultsDeep=rS,E.defer=dx,E.delay=px,E.difference=N_,E.differenceBy=F_,E.differenceWith=B_,E.drop=H_,E.dropRight=z_,E.dropRightWhile=W_,E.dropWhile=j_,E.fill=$_,E.filter=Vw,E.flatMap=Yw,E.flatMapDeep=Kw,E.flatMapDepth=Gw,E.flatten=Ep,E.flattenDeep=U_,E.flattenDepth=V_,E.flip=gx,E.flow=uT,E.flowRight=hT,E.fromPairs=q_,E.functions=hS,E.functionsIn=fS,E.groupBy=Jw,E.initial=Y_,E.intersection=K_,E.intersectionBy=G_,E.intersectionWith=J_,E.invert=pS,E.invertBy=gS,E.invokeMap=Qw,E.iteratee=Ch,E.keyBy=tx,E.keys=Ee,E.keysIn=rn,E.map=bl,E.mapKeys=vS,E.mapValues=bS,E.matches=fT,E.matchesProperty=dT,E.memoize=_l,E.merge=yS,E.mergeWith=Jp,E.method=pT,E.methodOf=gT,E.mixin=Oh,E.negate=wl,E.nthArg=vT,E.omit=_S,E.omitBy=wS,E.once=mx,E.orderBy=ex,E.over=bT,E.overArgs=vx,E.overEvery=yT,E.overSome=_T,E.partial=bh,E.partialRight=jp,E.partition=nx,E.pick=xS,E.pickBy=Zp,E.property=sg,E.propertyOf=wT,E.pull=ew,E.pullAll=Mp,E.pullAllBy=nw,E.pullAllWith=iw,E.pullAt=rw,E.range=xT,E.rangeRight=ST,E.rearg=bx,E.reject=sx,E.remove=sw,E.rest=yx,E.reverse=gh,E.sampleSize=ax,E.set=TS,E.setWith=CS,E.shuffle=lx,E.slice=ow,E.sortBy=hx,E.sortedUniq=dw,E.sortedUniqBy=pw,E.split=YS,E.spread=_x,E.tail=gw,E.take=mw,E.takeRight=vw,E.takeRightWhile=bw,E.takeWhile=yw,E.tap=Lw,E.throttle=wx,E.thru=vl,E.toArray=Xp,E.toPairs=Qp,E.toPairsIn=tg,E.toPath=AT,E.toPlainObject=Kp,E.transform=OS,E.unary=xx,E.union=_w,E.unionBy=ww,E.unionWith=xw,E.uniq=Sw,E.uniqBy=Tw,E.uniqWith=Cw,E.unset=kS,E.unzip=mh,E.unzipWith=Rp,E.update=AS,E.updateWith=ES,E.values=os,E.valuesIn=PS,E.without=Ow,E.words=ig,E.wrap=Sx,E.xor=kw,E.xorBy=Aw,E.xorWith=Ew,E.zip=Pw,E.zipObject=Mw,E.zipObjectDeep=Rw,E.zipWith=Dw,E.entries=Qp,E.entriesIn=tg,E.extend=Gp,E.extendWith=Tl,Oh(E,E),E.add=PT,E.attempt=rg,E.camelCase=LS,E.capitalize=eg,E.ceil=MT,E.clamp=MS,E.clone=Cx,E.cloneDeep=kx,E.cloneDeepWith=Ax,E.cloneWith=Ox,E.conformsTo=Ex,E.deburr=ng,E.defaultTo=cT,E.divide=RT,E.endsWith=IS,E.eq=Hn,E.escape=NS,E.escapeRegExp=FS,E.every=Uw,E.find=qw,E.findIndex=kp,E.findKey=sS,E.findLast=Xw,E.findLastIndex=Ap,E.findLastKey=oS,E.floor=DT,E.forEach=Lp,E.forEachRight=Ip,E.forIn=aS,E.forInRight=lS,E.forOwn=cS,E.forOwnRight=uS,E.get=wh,E.gt=Px,E.gte=Mx,E.has=dS,E.hasIn=xh,E.head=Pp,E.identity=sn,E.includes=Zw,E.indexOf=X_,E.inRange=RS,E.invoke=mS,E.isArguments=gr,E.isArray=kt,E.isArrayBuffer=Rx,E.isArrayLike=nn,E.isArrayLikeObject=pe,E.isBoolean=Dx,E.isBuffer=Hi,E.isDate=Lx,E.isElement=Ix,E.isEmpty=Nx,E.isEqual=Fx,E.isEqualWith=Bx,E.isError=yh,E.isFinite=Hx,E.isFunction=mi,E.isInteger=$p,E.isLength=xl,E.isMap=Up,E.isMatch=zx,E.isMatchWith=Wx,E.isNaN=jx,E.isNative=$x,E.isNil=Vx,E.isNull=Ux,E.isNumber=Vp,E.isObject=se,E.isObjectLike=ae,E.isPlainObject=ho,E.isRegExp=_h,E.isSafeInteger=qx,E.isSet=qp,E.isString=Sl,E.isSymbol=mn,E.isTypedArray=ss,E.isUndefined=Xx,E.isWeakMap=Yx,E.isWeakSet=Kx,E.join=Z_,E.kebabCase=BS,E.last=An,E.lastIndexOf=Q_,E.lowerCase=HS,E.lowerFirst=zS,E.lt=Gx,E.lte=Jx,E.max=LT,E.maxBy=IT,E.mean=NT,E.meanBy=FT,E.min=BT,E.minBy=HT,E.stubArray=Ah,E.stubFalse=Eh,E.stubObject=TT,E.stubString=CT,E.stubTrue=OT,E.multiply=zT,E.nth=tw,E.noConflict=mT,E.noop=kh,E.now=yl,E.pad=WS,E.padEnd=jS,E.padStart=$S,E.parseInt=US,E.random=DS,E.reduce=ix,E.reduceRight=rx,E.repeat=VS,E.replace=qS,E.result=SS,E.round=WT,E.runInContext=b,E.sample=ox,E.size=cx,E.snakeCase=XS,E.some=ux,E.sortedIndex=aw,E.sortedIndexBy=lw,E.sortedIndexOf=cw,E.sortedLastIndex=uw,E.sortedLastIndexBy=hw,E.sortedLastIndexOf=fw,E.startCase=KS,E.startsWith=GS,E.subtract=jT,E.sum=$T,E.sumBy=UT,E.template=JS,E.times=kT,E.toFinite=vi,E.toInteger=At,E.toLength=Yp,E.toLower=ZS,E.toNumber=En,E.toSafeInteger=Zx,E.toString=Wt,E.toUpper=QS,E.trim=tT,E.trimEnd=eT,E.trimStart=nT,E.truncate=iT,E.unescape=rT,E.uniqueId=ET,E.upperCase=sT,E.upperFirst=Sh,E.each=Lp,E.eachRight=Ip,E.first=Pp,Oh(E,function(){var o={};return Jn(E,function(c,f){Ht.call(E.prototype,f)||(o[f]=c)}),o}(),{chain:!1}),E.VERSION=i,Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){E[o].placeholder=E}),Ye(["drop","take"],function(o,c){Dt.prototype[o]=function(f){f=f===n?1:Ce(At(f),0);var _=this.__filtered__&&!c?new Dt(this):this.clone();return _.__filtered__?_.__takeCount__=Be(f,_.__takeCount__):_.__views__.push({size:Be(f,wt),type:o+(_.__dir__<0?"Right":"")}),_},Dt.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),Ye(["filter","map","takeWhile"],function(o,c){var f=c+1,_=f==st||f==it;Dt.prototype[o]=function(k){var P=this.clone();return P.__iteratees__.push({iteratee:pt(k,3),type:f}),P.__filtered__=P.__filtered__||_,P}}),Ye(["head","last"],function(o,c){var f="take"+(c?"Right":"");Dt.prototype[o]=function(){return this[f](1).value()[0]}}),Ye(["initial","tail"],function(o,c){var f="drop"+(c?"":"Right");Dt.prototype[o]=function(){return this.__filtered__?new Dt(this):this[f](1)}}),Dt.prototype.compact=function(){return this.filter(sn)},Dt.prototype.find=function(o){return this.filter(o).head()},Dt.prototype.findLast=function(o){return this.reverse().find(o)},Dt.prototype.invokeMap=Pt(function(o,c){return typeof o=="function"?new Dt(this):this.map(function(f){return so(f,o,c)})}),Dt.prototype.reject=function(o){return this.filter(wl(pt(o)))},Dt.prototype.slice=function(o,c){o=At(o);var f=this;return f.__filtered__&&(o>0||c<0)?new Dt(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==n&&(c=At(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},Dt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Dt.prototype.toArray=function(){return this.take(wt)},Jn(Dt.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),_=/^(?:head|last)$/.test(c),k=E[_?"take"+(c=="last"?"Right":""):c],P=_||/^find/.test(c);k&&(E.prototype[c]=function(){var L=this.__wrapped__,z=_?[1]:arguments,$=L instanceof Dt,G=z[0],J=$||kt(L),Q=function(Mt){var It=k.apply(E,Xn([Mt],z));return _&&at?It[0]:It};J&&f&&typeof G=="function"&&G.length!=1&&($=J=!1);var at=this.__chain__,ft=!!this.__actions__.length,gt=P&&!at,Et=$&&!ft;if(!P&&J){L=Et?L:new Dt(this);var mt=o.apply(L,z);return mt.__actions__.push({func:vl,args:[Q],thisArg:n}),new Cn(mt,at)}return gt&&Et?o.apply(this,z):(mt=this.thru(Q),gt?_?mt.value()[0]:mt.value():mt)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(o){var c=rr[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",_=/^(?:pop|shift)$/.test(o);E.prototype[o]=function(){var k=arguments;if(_&&!this.__chain__){var P=this.value();return c.apply(kt(P)?P:[],k)}return this[f](function(L){return c.apply(kt(L)?L:[],k)})}}),Jn(Dt.prototype,function(o,c){var f=E[c];if(f){var _=f.name+"";Ht.call(ts,_)||(ts[_]=[]),ts[_].push({name:c,func:f})}}),ts[ul(n,A).name]=[{name:"wrapper",func:n}],Dt.prototype.clone=r0,Dt.prototype.reverse=s0,Dt.prototype.value=o0,E.prototype.at=Iw,E.prototype.chain=Nw,E.prototype.commit=Fw,E.prototype.next=Bw,E.prototype.plant=zw,E.prototype.reverse=Ww,E.prototype.toJSON=E.prototype.valueOf=E.prototype.value=jw,E.prototype.first=E.prototype.head,Js&&(E.prototype[Js]=Hw),E},g=p();li?((li.exports=g)._=g,Ds._=g):Te._=g}).call(KT)}(So,So.exports)),So.exports}var JT=GT();const ZT=zv(JT);function Wv(e,t){return function(){return e.apply(t,arguments)}}const{toString:QT}=Object.prototype,{getPrototypeOf:zf}=Object,{iterator:Oc,toStringTag:jv}=Symbol,kc=(e=>t=>{const n=QT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Un=e=>(e=e.toLowerCase(),t=>kc(t)===e),Ac=e=>t=>typeof t===e,{isArray:xs}=Array,ps=Ac("undefined");function Qo(e){return e!==null&&!ps(e)&&e.constructor!==null&&!ps(e.constructor)&&ln(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $v=Un("ArrayBuffer");function t1(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$v(e.buffer),t}const e1=Ac("string"),ln=Ac("function"),Uv=Ac("number"),ta=e=>e!==null&&typeof e=="object",n1=e=>e===!0||e===!1,Yl=e=>{if(kc(e)!=="object")return!1;const t=zf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(jv in e)&&!(Oc in e)},i1=e=>{if(!ta(e)||Qo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},r1=Un("Date"),s1=Un("File"),o1=e=>!!(e&&typeof e.uri<"u"),a1=e=>e&&typeof e.getParts<"u",l1=Un("Blob"),c1=Un("FileList"),u1=e=>ta(e)&&ln(e.pipe);function h1(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const cg=h1(),ug=typeof cg.FormData<"u"?cg.FormData:void 0,f1=e=>{let t;return e&&(ug&&e instanceof ug||ln(e.append)&&((t=kc(e))==="formdata"||t==="object"&&ln(e.toString)&&e.toString()==="[object FormData]"))},d1=Un("URLSearchParams"),[p1,g1,m1,v1]=["ReadableStream","Request","Response","Headers"].map(Un),b1=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ea(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),xs(e))for(i=0,r=e.length;i<r;i++)t.call(null,e[i],i,e);else{if(Qo(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),a=s.length;let l;for(i=0;i<a;i++)l=s[i],t.call(null,e[l],l,e)}}function Vv(e,t){if(Qo(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,r;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qv=e=>!ps(e)&&e!==Cr;function lf(){const{caseless:e,skipUndefined:t}=qv(this)&&this||{},n={},i=(r,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=e&&Vv(n,s)||s;Yl(n[a])&&Yl(r)?n[a]=lf(n[a],r):Yl(r)?n[a]=lf({},r):xs(r)?n[a]=r.slice():(!t||!ps(r))&&(n[a]=r)};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&ea(arguments[r],i);return n}const y1=(e,t,n,{allOwnKeys:i}={})=>(ea(t,(r,s)=>{n&&ln(r)?Object.defineProperty(e,s,{value:Wv(r,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),_1=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),w1=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},x1=(e,t,n,i)=>{let r,s,a;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)a=r[s],(!i||i(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&zf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},S1=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},T1=e=>{if(!e)return null;if(xs(e))return e;let t=e.length;if(!Uv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},C1=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&zf(Uint8Array)),O1=(e,t)=>{const i=(e&&e[Oc]).call(e);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},k1=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},A1=Un("HTMLFormElement"),E1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),hg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),P1=Un("RegExp"),Xv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};ea(n,(r,s)=>{let a;(a=t(r,s,e))!==!1&&(i[s]=a||r)}),Object.defineProperties(e,i)},M1=e=>{Xv(e,(t,n)=>{if(ln(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(ln(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},R1=(e,t)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return xs(e)?i(e):i(String(e).split(t)),n},D1=()=>{},L1=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function I1(e){return!!(e&&ln(e.append)&&e[jv]==="FormData"&&e[Oc])}const N1=e=>{const t=new Array(10),n=(i,r)=>{if(ta(i)){if(t.indexOf(i)>=0)return;if(Qo(i))return i;if(!("toJSON"in i)){t[r]=i;const s=xs(i)?[]:{};return ea(i,(a,l)=>{const u=n(a,r+1);!ps(u)&&(s[l]=u)}),t[r]=void 0,s}}return i};return n(e,0)},F1=Un("AsyncFunction"),B1=e=>e&&(ta(e)||ln(e))&&ln(e.then)&&ln(e.catch),Yv=((e,t)=>e?setImmediate:t?((n,i)=>(Cr.addEventListener("message",({source:r,data:s})=>{r===Cr&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),Cr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ln(Cr.postMessage)),H1=typeof queueMicrotask<"u"?queueMicrotask.bind(Cr):typeof process<"u"&&process.nextTick||Yv,z1=e=>e!=null&&ln(e[Oc]),X={isArray:xs,isArrayBuffer:$v,isBuffer:Qo,isFormData:f1,isArrayBufferView:t1,isString:e1,isNumber:Uv,isBoolean:n1,isObject:ta,isPlainObject:Yl,isEmptyObject:i1,isReadableStream:p1,isRequest:g1,isResponse:m1,isHeaders:v1,isUndefined:ps,isDate:r1,isFile:s1,isReactNativeBlob:o1,isReactNative:a1,isBlob:l1,isRegExp:P1,isFunction:ln,isStream:u1,isURLSearchParams:d1,isTypedArray:C1,isFileList:c1,forEach:ea,merge:lf,extend:y1,trim:b1,stripBOM:_1,inherits:w1,toFlatObject:x1,kindOf:kc,kindOfTest:Un,endsWith:S1,toArray:T1,forEachEntry:O1,matchAll:k1,isHTMLForm:A1,hasOwnProperty:hg,hasOwnProp:hg,reduceDescriptors:Xv,freezeMethods:M1,toObjectSet:R1,toCamelCase:E1,noop:D1,toFiniteNumber:L1,findKey:Vv,global:Cr,isContextDefined:qv,isSpecCompliantForm:I1,toJSONObject:N1,isAsyncFn:F1,isThenable:B1,setImmediate:Yv,asap:H1,isIterable:z1};let bt=class Kv extends Error{static from(t,n,i,r,s,a){const l=new Kv(t.message,n||t.code,i,r,s);return l.cause=t,l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,n,i,r,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:X.toJSONObject(this.config),code:this.code,status:this.status}}};bt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";bt.ERR_BAD_OPTION="ERR_BAD_OPTION";bt.ECONNABORTED="ECONNABORTED";bt.ETIMEDOUT="ETIMEDOUT";bt.ERR_NETWORK="ERR_NETWORK";bt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";bt.ERR_DEPRECATED="ERR_DEPRECATED";bt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";bt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";bt.ERR_CANCELED="ERR_CANCELED";bt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";bt.ERR_INVALID_URL="ERR_INVALID_URL";const W1=null;function cf(e){return X.isPlainObject(e)||X.isArray(e)}function Gv(e){return X.endsWith(e,"[]")?e.slice(0,-2):e}function Ph(e,t,n){return e?e.concat(t).map(function(r,s){return r=Gv(r),!n&&s?"["+r+"]":r}).join(n?".":""):t}function j1(e){return X.isArray(e)&&!e.some(cf)}const $1=X.toFlatObject(X,{},null,function(t){return/^is[A-Z]/.test(t)});function Ec(e,t,n){if(!X.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=X.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,T){return!X.isUndefined(T[C])});const i=n.metaTokens,r=n.visitor||d,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&X.isSpecCompliantForm(t);if(!X.isFunction(r))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(X.isDate(S))return S.toISOString();if(X.isBoolean(S))return S.toString();if(!u&&X.isBlob(S))throw new bt("Blob is not supported. Use a Buffer instead.");return X.isArrayBuffer(S)||X.isTypedArray(S)?u&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function d(S,C,T){let A=S;if(X.isReactNative(t)&&X.isReactNativeBlob(S))return t.append(Ph(T,C,s),h(S)),!1;if(S&&!T&&typeof S=="object"){if(X.endsWith(C,"{}"))C=i?C:C.slice(0,-2),S=JSON.stringify(S);else if(X.isArray(S)&&j1(S)||(X.isFileList(S)||X.endsWith(C,"[]"))&&(A=X.toArray(S)))return C=Gv(C),A.forEach(function(B,D){!(X.isUndefined(B)||B===null)&&t.append(a===!0?Ph([C],D,s):a===null?C:C+"[]",h(B))}),!1}return cf(S)?!0:(t.append(Ph(T,C,s),h(S)),!1)}const m=[],y=Object.assign($1,{defaultVisitor:d,convertValue:h,isVisitable:cf});function x(S,C){if(!X.isUndefined(S)){if(m.indexOf(S)!==-1)throw Error("Circular reference detected in "+C.join("."));m.push(S),X.forEach(S,function(A,M){(!(X.isUndefined(A)||A===null)&&r.call(t,A,X.isString(M)?M.trim():M,C,y))===!0&&x(A,C?C.concat(M):[M])}),m.pop()}}if(!X.isObject(e))throw new TypeError("data must be an object");return x(e),t}function fg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Wf(e,t){this._pairs=[],e&&Ec(e,this,t)}const Jv=Wf.prototype;Jv.append=function(t,n){this._pairs.push([t,n])};Jv.toString=function(t){const n=t?function(i){return t.call(this,i,fg)}:fg;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function U1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Zv(e,t,n){if(!t)return e;const i=n&&n.encode||U1,r=X.isFunction(n)?{serialize:n}:n,s=r&&r.serialize;let a;if(s?a=s(t,r):a=X.isURLSearchParams(t)?t.toString():new Wf(t,r).toString(i),a){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class dg{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){X.forEach(this.handlers,function(i){i!==null&&t(i)})}}const jf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},V1=typeof URLSearchParams<"u"?URLSearchParams:Wf,q1=typeof FormData<"u"?FormData:null,X1=typeof Blob<"u"?Blob:null,Y1={isBrowser:!0,classes:{URLSearchParams:V1,FormData:q1,Blob:X1},protocols:["http","https","file","blob","url","data"]},$f=typeof window<"u"&&typeof document<"u",uf=typeof navigator=="object"&&navigator||void 0,K1=$f&&(!uf||["ReactNative","NativeScript","NS"].indexOf(uf.product)<0),G1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",J1=$f&&window.location.href||"http://localhost",Z1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$f,hasStandardBrowserEnv:K1,hasStandardBrowserWebWorkerEnv:G1,navigator:uf,origin:J1},Symbol.toStringTag,{value:"Module"})),je={...Z1,...Y1};function Q1(e,t){return Ec(e,new je.classes.URLSearchParams,{visitor:function(n,i,r,s){return je.isNode&&X.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function tC(e){return X.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function eC(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i<r;i++)s=n[i],t[s]=e[s];return t}function Qv(e){function t(n,i,r,s){let a=n[s++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),u=s>=n.length;return a=!a&&X.isArray(r)?r.length:a,u?(X.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i,!l):((!r[a]||!X.isObject(r[a]))&&(r[a]=[]),t(n,i,r[a],s)&&X.isArray(r[a])&&(r[a]=eC(r[a])),!l)}if(X.isFormData(e)&&X.isFunction(e.entries)){const n={};return X.forEachEntry(e,(i,r)=>{t(tC(i),r,n,0)}),n}return null}function nC(e,t,n){if(X.isString(e))try{return(t||JSON.parse)(e),X.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const na={transitional:jf,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=X.isObject(t);if(s&&X.isHTMLForm(t)&&(t=new FormData(t)),X.isFormData(t))return r?JSON.stringify(Qv(t)):t;if(X.isArrayBuffer(t)||X.isBuffer(t)||X.isStream(t)||X.isFile(t)||X.isBlob(t)||X.isReadableStream(t))return t;if(X.isArrayBufferView(t))return t.buffer;if(X.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Q1(t,this.formSerializer).toString();if((l=X.isFileList(t))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ec(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),nC(t)):t}],transformResponse:[function(t){const n=this.transitional||na.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(X.isResponse(t)||X.isReadableStream(t))return t;if(t&&X.isString(t)&&(i&&!this.responseType||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?bt.from(l,bt.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],e=>{na.headers[e]={}});const iC=X.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),rC=e=>{const t={};let n,i,r;return e&&e.split(`
`).forEach(function(a){r=a.indexOf(":"),n=a.substring(0,r).trim().toLowerCase(),i=a.substring(r+1).trim(),!(!n||t[n]&&iC[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},pg=Symbol("internals");function fo(e){return e&&String(e).trim().toLowerCase()}function Kl(e){return e===!1||e==null?e:X.isArray(e)?e.map(Kl):String(e)}function sC(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const oC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Mh(e,t,n,i,r){if(X.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!X.isString(t)){if(X.isString(i))return t.indexOf(i)!==-1;if(X.isRegExp(i))return i.test(t)}}function aC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function lC(e,t){const n=X.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,s,a){return this[i].call(this,t,r,s,a)},configurable:!0})})}let cn=class{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function s(l,u,h){const d=fo(u);if(!d)throw new Error("header name must be a non-empty string");const m=X.findKey(r,d);(!m||r[m]===void 0||h===!0||h===void 0&&r[m]!==!1)&&(r[m||u]=Kl(l))}const a=(l,u)=>X.forEach(l,(h,d)=>s(h,d,u));if(X.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(X.isString(t)&&(t=t.trim())&&!oC(t))a(rC(t),n);else if(X.isObject(t)&&X.isIterable(t)){let l={},u,h;for(const d of t){if(!X.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[h=d[0]]=(u=l[h])?X.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}a(l,n)}else t!=null&&s(n,t,i);return this}get(t,n){if(t=fo(t),t){const i=X.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return sC(r);if(X.isFunction(n))return n.call(this,r,i);if(X.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=fo(t),t){const i=X.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Mh(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function s(a){if(a=fo(a),a){const l=X.findKey(i,a);l&&(!n||Mh(i,i[l],l,n))&&(delete i[l],r=!0)}}return X.isArray(t)?t.forEach(s):s(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!t||Mh(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const n=this,i={};return X.forEach(this,(r,s)=>{const a=X.findKey(i,s);if(a){n[a]=Kl(r),delete n[s];return}const l=t?aC(s):String(s).trim();l!==s&&delete n[s],n[l]=Kl(r),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return X.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&X.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[pg]=this[pg]={accessors:{}}).accessors,r=this.prototype;function s(a){const l=fo(a);i[l]||(lC(r,a),i[l]=!0)}return X.isArray(t)?t.forEach(s):s(t),this}};cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);X.reduceDescriptors(cn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});X.freezeMethods(cn);function Rh(e,t){const n=this||na,i=t||n,r=cn.from(i.headers);let s=i.data;return X.forEach(e,function(l){s=l.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function tb(e){return!!(e&&e.__CANCEL__)}let ia=class extends bt{constructor(t,n,i){super(t??"canceled",bt.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function eb(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new bt("Request failed with status code "+n.status,[bt.ERR_BAD_REQUEST,bt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cC(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function uC(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,s=0,a;return t=t!==void 0?t:1e3,function(u){const h=Date.now(),d=i[s];a||(a=h),n[r]=u,i[r]=h;let m=s,y=0;for(;m!==r;)y+=n[m++],m=m%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),h-a<t)return;const x=d&&h-d;return x?Math.round(y*1e3/x):void 0}}function hC(e,t){let n=0,i=1e3/t,r,s;const a=(h,d=Date.now())=>{n=d,r=null,s&&(clearTimeout(s),s=null),e(...h)};return[(...h)=>{const d=Date.now(),m=d-n;m>=i?a(h,d):(r=h,s||(s=setTimeout(()=>{s=null,a(r)},i-m)))},()=>r&&a(r)]}const cc=(e,t,n=3)=>{let i=0;const r=uC(50,250);return hC(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-i,h=r(u),d=a<=l;i=a;const m={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l&&d?(l-a)/h:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(m)},n)},gg=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},mg=e=>(...t)=>X.asap(()=>e(...t)),fC=je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(je.origin),je.navigator&&/(msie|trident)/i.test(je.navigator.userAgent)):()=>!0,dC=je.hasStandardBrowserEnv?{write(e,t,n,i,r,s,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];X.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),X.isString(i)&&l.push(`path=${i}`),X.isString(r)&&l.push(`domain=${r}`),s===!0&&l.push("secure"),X.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function pC(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nb(e,t,n){let i=!pC(t);return e&&(i||n==!1)?gC(e,t):t}const vg=e=>e instanceof cn?{...e}:e;function Mr(e,t){t=t||{};const n={};function i(h,d,m,y){return X.isPlainObject(h)&&X.isPlainObject(d)?X.merge.call({caseless:y},h,d):X.isPlainObject(d)?X.merge({},d):X.isArray(d)?d.slice():d}function r(h,d,m,y){if(X.isUndefined(d)){if(!X.isUndefined(h))return i(void 0,h,m,y)}else return i(h,d,m,y)}function s(h,d){if(!X.isUndefined(d))return i(void 0,d)}function a(h,d){if(X.isUndefined(d)){if(!X.isUndefined(h))return i(void 0,h)}else return i(void 0,d)}function l(h,d,m){if(m in t)return i(h,d);if(m in e)return i(void 0,h)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(h,d,m)=>r(vg(h),vg(d),m,!0)};return X.forEach(Object.keys({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const m=X.hasOwnProp(u,d)?u[d]:r,y=m(e[d],t[d],d);X.isUndefined(y)&&m!==l||(n[d]=y)}),n}const ib=e=>{const t=Mr({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=cn.from(a),t.url=Zv(nb(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),X.isFormData(n)){if(je.hasStandardBrowserEnv||je.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(X.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{h.includes(d.toLowerCase())&&a.set(d,m)})}}if(je.hasStandardBrowserEnv&&(i&&X.isFunction(i)&&(i=i(t)),i||i!==!1&&fC(t.url))){const u=r&&s&&dC.read(s);u&&a.set(r,u)}return t},mC=typeof XMLHttpRequest<"u",vC=mC&&function(e){return new Promise(function(n,i){const r=ib(e);let s=r.data;const a=cn.from(r.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:h}=r,d,m,y,x,S;function C(){x&&x(),S&&S(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let T=new XMLHttpRequest;T.open(r.method.toUpperCase(),r.url,!0),T.timeout=r.timeout;function A(){if(!T)return;const B=cn.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),R={data:!l||l==="text"||l==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:B,config:e,request:T};eb(function(I){n(I),C()},function(I){i(I),C()},R),T=null}"onloadend"in T?T.onloadend=A:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(A)},T.onabort=function(){T&&(i(new bt("Request aborted",bt.ECONNABORTED,e,T)),T=null)},T.onerror=function(D){const R=D&&D.message?D.message:"Network Error",N=new bt(R,bt.ERR_NETWORK,e,T);N.event=D||null,i(N),T=null},T.ontimeout=function(){let D=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const R=r.transitional||jf;r.timeoutErrorMessage&&(D=r.timeoutErrorMessage),i(new bt(D,R.clarifyTimeoutError?bt.ETIMEDOUT:bt.ECONNABORTED,e,T)),T=null},s===void 0&&a.setContentType(null),"setRequestHeader"in T&&X.forEach(a.toJSON(),function(D,R){T.setRequestHeader(R,D)}),X.isUndefined(r.withCredentials)||(T.withCredentials=!!r.withCredentials),l&&l!=="json"&&(T.responseType=r.responseType),h&&([y,S]=cc(h,!0),T.addEventListener("progress",y)),u&&T.upload&&([m,x]=cc(u),T.upload.addEventListener("progress",m),T.upload.addEventListener("loadend",x)),(r.cancelToken||r.signal)&&(d=B=>{T&&(i(!B||B.type?new ia(null,e,T):B),T.abort(),T=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const M=cC(r.url);if(M&&je.protocols.indexOf(M)===-1){i(new bt("Unsupported protocol "+M+":",bt.ERR_BAD_REQUEST,e));return}T.send(s||null)})},bC=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,r;const s=function(h){if(!r){r=!0,l();const d=h instanceof Error?h:this.reason;i.abort(d instanceof bt?d:new ia(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,s(new bt(`timeout of ${t}ms exceeded`,bt.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),e=null)};e.forEach(h=>h.addEventListener("abort",s));const{signal:u}=i;return u.unsubscribe=()=>X.asap(l),u}},yC=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,r;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},_C=async function*(e,t){for await(const n of wC(e))yield*yC(n,t)},wC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},bg=(e,t,n,i)=>{const r=_C(e,t);let s=0,a,l=u=>{a||(a=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:h,value:d}=await r.next();if(h){l(),u.close();return}let m=d.byteLength;if(n){let y=s+=m;n(y)}u.enqueue(new Uint8Array(d))}catch(h){throw l(h),h}},cancel(u){return l(u),r.return()}},{highWaterMark:2})},yg=64*1024,{isFunction:Ol}=X,xC=(({Request:e,Response:t})=>({Request:e,Response:t}))(X.global),{ReadableStream:_g,TextEncoder:wg}=X.global,xg=(e,...t)=>{try{return!!e(...t)}catch{return!1}},SC=e=>{e=X.merge.call({skipUndefined:!0},xC,e);const{fetch:t,Request:n,Response:i}=e,r=t?Ol(t):typeof fetch=="function",s=Ol(n),a=Ol(i);if(!r)return!1;const l=r&&Ol(_g),u=r&&(typeof wg=="function"?(S=>C=>S.encode(C))(new wg):async S=>new Uint8Array(await new n(S).arrayBuffer())),h=s&&l&&xg(()=>{let S=!1;const C=new n(je.origin,{body:new _g,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!C}),d=a&&l&&xg(()=>X.isReadableStream(new i("").body)),m={stream:d&&(S=>S.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!m[S]&&(m[S]=(C,T)=>{let A=C&&C[S];if(A)return A.call(C);throw new bt(`Response type '${S}' is not supported`,bt.ERR_NOT_SUPPORT,T)})});const y=async S=>{if(S==null)return 0;if(X.isBlob(S))return S.size;if(X.isSpecCompliantForm(S))return(await new n(je.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(X.isArrayBufferView(S)||X.isArrayBuffer(S))return S.byteLength;if(X.isURLSearchParams(S)&&(S=S+""),X.isString(S))return(await u(S)).byteLength},x=async(S,C)=>{const T=X.toFiniteNumber(S.getContentLength());return T??y(C)};return async S=>{let{url:C,method:T,data:A,signal:M,cancelToken:B,timeout:D,onDownloadProgress:R,onUploadProgress:N,responseType:I,headers:j,withCredentials:q="same-origin",fetchOptions:F}=ib(S),H=t||fetch;I=I?(I+"").toLowerCase():"text";let U=bC([M,B&&B.toAbortSignal()],D),V=null;const st=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let tt;try{if(N&&h&&T!=="get"&&T!=="head"&&(tt=await x(j,A))!==0){let wt=new n(C,{method:"POST",body:A,duplex:"half"}),vt;if(X.isFormData(A)&&(vt=wt.headers.get("content-type"))&&j.setContentType(vt),wt.body){const[Ft,xt]=gg(tt,cc(mg(N)));A=bg(wt.body,yg,Ft,xt)}}X.isString(q)||(q=q?"include":"omit");const it=s&&"credentials"in n.prototype,K={...F,signal:U,method:T.toUpperCase(),headers:j.normalize().toJSON(),body:A,duplex:"half",credentials:it?q:void 0};V=s&&new n(C,K);let ct=await(s?H(V,F):H(C,K));const dt=d&&(I==="stream"||I==="response");if(d&&(R||dt&&st)){const wt={};["status","statusText","headers"].forEach(Ct=>{wt[Ct]=ct[Ct]});const vt=X.toFiniteNumber(ct.headers.get("content-length")),[Ft,xt]=R&&gg(vt,cc(mg(R),!0))||[];ct=new i(bg(ct.body,yg,Ft,()=>{xt&&xt(),st&&st()}),wt)}I=I||"text";let _t=await m[X.findKey(m,I)||"text"](ct,S);return!dt&&st&&st(),await new Promise((wt,vt)=>{eb(wt,vt,{data:_t,headers:cn.from(ct.headers),status:ct.status,statusText:ct.statusText,config:S,request:V})})}catch(it){throw st&&st(),it&&it.name==="TypeError"&&/Load failed|fetch/i.test(it.message)?Object.assign(new bt("Network Error",bt.ERR_NETWORK,S,V,it&&it.response),{cause:it.cause||it}):bt.from(it,it&&it.code,S,V,it&&it.response)}}},TC=new Map,rb=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:r}=t,s=[i,r,n];let a=s.length,l=a,u,h,d=TC;for(;l--;)u=s[l],h=d.get(u),h===void 0&&d.set(u,h=l?new Map:SC(t)),d=h;return h};rb();const Uf={http:W1,xhr:vC,fetch:{get:rb}};X.forEach(Uf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Sg=e=>`- ${e}`,CC=e=>X.isFunction(e)||e===null||e===!1;function OC(e,t){e=X.isArray(e)?e:[e];const{length:n}=e;let i,r;const s={};for(let a=0;a<n;a++){i=e[a];let l;if(r=i,!CC(i)&&(r=Uf[(l=String(i)).toLowerCase()],r===void 0))throw new bt(`Unknown adapter '${l}'`);if(r&&(X.isFunction(r)||(r=r.get(t))))break;s[l||"#"+a]=r}if(!r){const a=Object.entries(s).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
`+a.map(Sg).join(`
`):" "+Sg(a[0]):"as no adapter specified";throw new bt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r}const sb={getAdapter:OC,adapters:Uf};function Dh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ia(null,e)}function Tg(e){return Dh(e),e.headers=cn.from(e.headers),e.data=Rh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),sb.getAdapter(e.adapter||na.adapter,e)(e).then(function(i){return Dh(e),i.data=Rh.call(e,e.transformResponse,i),i.headers=cn.from(i.headers),i},function(i){return tb(i)||(Dh(e),i&&i.response&&(i.response.data=Rh.call(e,e.transformResponse,i.response),i.response.headers=cn.from(i.response.headers))),Promise.reject(i)})}const ob="1.13.6",Pc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pc[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const Cg={};Pc.transitional=function(t,n,i){function r(s,a){return"[Axios v"+ob+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return(s,a,l)=>{if(t===!1)throw new bt(r(a," has been removed"+(n?" in "+n:"")),bt.ERR_DEPRECATED);return n&&!Cg[a]&&(Cg[a]=!0,console.warn(r(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,a,l):!0}};Pc.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function kC(e,t,n){if(typeof e!="object")throw new bt("options must be an object",bt.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],a=t[s];if(a){const l=e[s],u=l===void 0||a(l,s,e);if(u!==!0)throw new bt("option "+s+" must be "+u,bt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new bt("Unknown option "+s,bt.ERR_BAD_OPTION)}}const Gl={assertOptions:kC,validators:Pc},Pn=Gl.validators;let kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dg,response:new dg}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=`
`+s):i.stack=s}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Mr(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&Gl.assertOptions(i,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean),legacyInterceptorReqResOrdering:Pn.transitional(Pn.boolean)},!1),r!=null&&(X.isFunction(r)?n.paramsSerializer={serialize:r}:Gl.assertOptions(r,{encode:Pn.function,serialize:Pn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gl.assertOptions(n,{baseUrl:Pn.spelling("baseURL"),withXsrfToken:Pn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&X.merge(s.common,s[n.method]);s&&X.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),n.headers=cn.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(n)===!1)return;u=u&&C.synchronous;const T=n.transitional||jf;T&&T.legacyInterceptorReqResOrdering?l.unshift(C.fulfilled,C.rejected):l.push(C.fulfilled,C.rejected)});const h=[];this.interceptors.response.forEach(function(C){h.push(C.fulfilled,C.rejected)});let d,m=0,y;if(!u){const S=[Tg.bind(this),void 0];for(S.unshift(...l),S.push(...h),y=S.length,d=Promise.resolve(n);m<y;)d=d.then(S[m++],S[m++]);return d}y=l.length;let x=n;for(;m<y;){const S=l[m++],C=l[m++];try{x=S(x)}catch(T){C.call(this,T);break}}try{d=Tg.call(this,x)}catch(S){return Promise.reject(S)}for(m=0,y=h.length;m<y;)d=d.then(h[m++],h[m++]);return d}getUri(t){t=Mr(this.defaults,t);const n=nb(t.baseURL,t.url,t.allowAbsoluteUrls);return Zv(n,t.params,t.paramsSerializer)}};X.forEach(["delete","get","head","options"],function(t){kr.prototype[t]=function(n,i){return this.request(Mr(i||{},{method:t,url:n,data:(i||{}).data}))}});X.forEach(["post","put","patch"],function(t){function n(i){return function(s,a,l){return this.request(Mr(l||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}kr.prototype[t]=n(),kr.prototype[t+"Form"]=n(!0)});let AC=class ab{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const i=this;this.promise.then(r=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(l=>{i.subscribe(l),s=l}).then(r);return a.cancel=function(){i.unsubscribe(s)},a},t(function(s,a,l){i.reason||(i.reason=new ia(s,a,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ab(function(r){t=r}),cancel:t}}};function EC(e){return function(n){return e.apply(null,n)}}function PC(e){return X.isObject(e)&&e.isAxiosError===!0}const hf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hf).forEach(([e,t])=>{hf[t]=e});function lb(e){const t=new kr(e),n=Wv(kr.prototype.request,t);return X.extend(n,kr.prototype,t,{allOwnKeys:!0}),X.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return lb(Mr(e,r))},n}const ve=lb(na);ve.Axios=kr;ve.CanceledError=ia;ve.CancelToken=AC;ve.isCancel=tb;ve.VERSION=ob;ve.toFormData=Ec;ve.AxiosError=bt;ve.Cancel=ve.CanceledError;ve.all=function(t){return Promise.all(t)};ve.spread=EC;ve.isAxiosError=PC;ve.mergeConfig=Mr;ve.AxiosHeaders=cn;ve.formToJSON=e=>Qv(X.isHTMLForm(e)?new FormData(e):e);ve.getAdapter=sb.getAdapter;ve.HttpStatusCode=hf;ve.default=ve;const{Axios:LD,AxiosError:ID,CanceledError:ND,isCancel:FD,CancelToken:BD,VERSION:HD,all:zD,Cancel:WD,isAxiosError:jD,spread:$D,toFormData:UD,AxiosHeaders:VD,HttpStatusCode:qD,formToJSON:XD,getAdapter:YD,mergeConfig:KD}=ve;window._=ZT;window.axios=ve;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios&&window.axios.interceptors.response.use(e=>e,e=>(e.response&&e.response.status===419&&(e.response.data&&e.response.data.action==="redirect"&&e.response.data.redirect_url?window.location.href=e.response.data.redirect_url:window.location.href="/login"),Promise.reject(e)));var un="top",Dn="bottom",Ln="right",hn="left",Vf="auto",ra=[un,Dn,Ln,hn],gs="start",Wo="end",MC="clippingParents",cb="viewport",po="popper",RC="reference",Og=ra.reduce(function(e,t){return e.concat([t+"-"+gs,t+"-"+Wo])},[]),ub=[].concat(ra,[Vf]).reduce(function(e,t){return e.concat([t,t+"-"+gs,t+"-"+Wo])},[]),DC="beforeRead",LC="read",IC="afterRead",NC="beforeMain",FC="main",BC="afterMain",HC="beforeWrite",zC="write",WC="afterWrite",jC=[DC,LC,IC,NC,FC,BC,HC,zC,WC];function si(e){return e?(e.nodeName||"").toLowerCase():null}function _n(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Rr(e){var t=_n(e).Element;return e instanceof t||e instanceof Element}function Rn(e){var t=_n(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function qf(e){if(typeof ShadowRoot>"u")return!1;var t=_n(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $C(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},r=t.attributes[n]||{},s=t.elements[n];!Rn(s)||!si(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var l=r[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function UC(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],s=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),l=a.reduce(function(u,h){return u[h]="",u},{});!Rn(r)||!si(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}const VC={name:"applyStyles",enabled:!0,phase:"write",fn:$C,effect:UC,requires:["computeStyles"]};function ii(e){return e.split("-")[0]}var Ar=Math.max,uc=Math.min,ms=Math.round;function ff(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hb(){return!/^((?!chrome|android).)*safari/i.test(ff())}function vs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),r=1,s=1;t&&Rn(e)&&(r=e.offsetWidth>0&&ms(i.width)/e.offsetWidth||1,s=e.offsetHeight>0&&ms(i.height)/e.offsetHeight||1);var a=Rr(e)?_n(e):window,l=a.visualViewport,u=!hb()&&n,h=(i.left+(u&&l?l.offsetLeft:0))/r,d=(i.top+(u&&l?l.offsetTop:0))/s,m=i.width/r,y=i.height/s;return{width:m,height:y,top:d,right:h+m,bottom:d+y,left:h,x:h,y:d}}function Xf(e){var t=vs(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function fb(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qf(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ki(e){return _n(e).getComputedStyle(e)}function qC(e){return["table","td","th"].indexOf(si(e))>=0}function Gi(e){return((Rr(e)?e.ownerDocument:e.document)||window.document).documentElement}function Mc(e){return si(e)==="html"?e:e.assignedSlot||e.parentNode||(qf(e)?e.host:null)||Gi(e)}function kg(e){return!Rn(e)||ki(e).position==="fixed"?null:e.offsetParent}function XC(e){var t=/firefox/i.test(ff()),n=/Trident/i.test(ff());if(n&&Rn(e)){var i=ki(e);if(i.position==="fixed")return null}var r=Mc(e);for(qf(r)&&(r=r.host);Rn(r)&&["html","body"].indexOf(si(r))<0;){var s=ki(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function sa(e){for(var t=_n(e),n=kg(e);n&&qC(n)&&ki(n).position==="static";)n=kg(n);return n&&(si(n)==="html"||si(n)==="body"&&ki(n).position==="static")?t:n||XC(e)||t}function Yf(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Do(e,t,n){return Ar(e,uc(t,n))}function YC(e,t,n){var i=Do(e,t,n);return i>n?n:i}function db(){return{top:0,right:0,bottom:0,left:0}}function pb(e){return Object.assign({},db(),e)}function gb(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var KC=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,pb(typeof t!="number"?t:gb(t,ra))};function GC(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=ii(n.placement),u=Yf(l),h=[hn,Ln].indexOf(l)>=0,d=h?"height":"width";if(!(!s||!a)){var m=KC(r.padding,n),y=Xf(s),x=u==="y"?un:hn,S=u==="y"?Dn:Ln,C=n.rects.reference[d]+n.rects.reference[u]-a[u]-n.rects.popper[d],T=a[u]-n.rects.reference[u],A=sa(s),M=A?u==="y"?A.clientHeight||0:A.clientWidth||0:0,B=C/2-T/2,D=m[x],R=M-y[d]-m[S],N=M/2-y[d]/2+B,I=Do(D,N,R),j=u;n.modifiersData[i]=(t={},t[j]=I,t.centerOffset=I-N,t)}}function JC(e){var t=e.state,n=e.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||fb(t.elements.popper,r)&&(t.elements.arrow=r))}const ZC={name:"arrow",enabled:!0,phase:"main",fn:GC,effect:JC,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bs(e){return e.split("-")[1]}var QC={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tO(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:ms(n*r)/r||0,y:ms(i*r)/r||0}}function Ag(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,a=e.offsets,l=e.position,u=e.gpuAcceleration,h=e.adaptive,d=e.roundOffsets,m=e.isFixed,y=a.x,x=y===void 0?0:y,S=a.y,C=S===void 0?0:S,T=typeof d=="function"?d({x,y:C}):{x,y:C};x=T.x,C=T.y;var A=a.hasOwnProperty("x"),M=a.hasOwnProperty("y"),B=hn,D=un,R=window;if(h){var N=sa(n),I="clientHeight",j="clientWidth";if(N===_n(n)&&(N=Gi(n),ki(N).position!=="static"&&l==="absolute"&&(I="scrollHeight",j="scrollWidth")),N=N,r===un||(r===hn||r===Ln)&&s===Wo){D=Dn;var q=m&&N===R&&R.visualViewport?R.visualViewport.height:N[I];C-=q-i.height,C*=u?1:-1}if(r===hn||(r===un||r===Dn)&&s===Wo){B=Ln;var F=m&&N===R&&R.visualViewport?R.visualViewport.width:N[j];x-=F-i.width,x*=u?1:-1}}var H=Object.assign({position:l},h&&QC),U=d===!0?tO({x,y:C},_n(n)):{x,y:C};if(x=U.x,C=U.y,u){var V;return Object.assign({},H,(V={},V[D]=M?"0":"",V[B]=A?"0":"",V.transform=(R.devicePixelRatio||1)<=1?"translate("+x+"px, "+C+"px)":"translate3d("+x+"px, "+C+"px, 0)",V))}return Object.assign({},H,(t={},t[D]=M?C+"px":"",t[B]=A?x+"px":"",t.transform="",t))}function eO(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=i===void 0?!0:i,s=n.adaptive,a=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,h={placement:ii(t.placement),variation:bs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ag(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ag(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const nO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:eO,data:{}};var kl={passive:!0};function iO(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,l=a===void 0?!0:a,u=_n(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&h.forEach(function(d){d.addEventListener("scroll",n.update,kl)}),l&&u.addEventListener("resize",n.update,kl),function(){s&&h.forEach(function(d){d.removeEventListener("scroll",n.update,kl)}),l&&u.removeEventListener("resize",n.update,kl)}}const rO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:iO,data:{}};var sO={left:"right",right:"left",bottom:"top",top:"bottom"};function Jl(e){return e.replace(/left|right|bottom|top/g,function(t){return sO[t]})}var oO={start:"end",end:"start"};function Eg(e){return e.replace(/start|end/g,function(t){return oO[t]})}function Kf(e){var t=_n(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Gf(e){return vs(Gi(e)).left+Kf(e).scrollLeft}function aO(e,t){var n=_n(e),i=Gi(e),r=n.visualViewport,s=i.clientWidth,a=i.clientHeight,l=0,u=0;if(r){s=r.width,a=r.height;var h=hb();(h||!h&&t==="fixed")&&(l=r.offsetLeft,u=r.offsetTop)}return{width:s,height:a,x:l+Gf(e),y:u}}function lO(e){var t,n=Gi(e),i=Kf(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=Ar(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ar(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Gf(e),u=-i.scrollTop;return ki(r||n).direction==="rtl"&&(l+=Ar(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:l,y:u}}function Jf(e){var t=ki(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function mb(e){return["html","body","#document"].indexOf(si(e))>=0?e.ownerDocument.body:Rn(e)&&Jf(e)?e:mb(Mc(e))}function Lo(e,t){var n;t===void 0&&(t=[]);var i=mb(e),r=i===((n=e.ownerDocument)==null?void 0:n.body),s=_n(i),a=r?[s].concat(s.visualViewport||[],Jf(i)?i:[]):i,l=t.concat(a);return r?l:l.concat(Lo(Mc(a)))}function df(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cO(e,t){var n=vs(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Pg(e,t,n){return t===cb?df(aO(e,n)):Rr(t)?cO(t,n):df(lO(Gi(e)))}function uO(e){var t=Lo(Mc(e)),n=["absolute","fixed"].indexOf(ki(e).position)>=0,i=n&&Rn(e)?sa(e):e;return Rr(i)?t.filter(function(r){return Rr(r)&&fb(r,i)&&si(r)!=="body"}):[]}function hO(e,t,n,i){var r=t==="clippingParents"?uO(e):[].concat(t),s=[].concat(r,[n]),a=s[0],l=s.reduce(function(u,h){var d=Pg(e,h,i);return u.top=Ar(d.top,u.top),u.right=uc(d.right,u.right),u.bottom=uc(d.bottom,u.bottom),u.left=Ar(d.left,u.left),u},Pg(e,a,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function vb(e){var t=e.reference,n=e.element,i=e.placement,r=i?ii(i):null,s=i?bs(i):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(r){case un:u={x:a,y:t.y-n.height};break;case Dn:u={x:a,y:t.y+t.height};break;case Ln:u={x:t.x+t.width,y:l};break;case hn:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var h=r?Yf(r):null;if(h!=null){var d=h==="y"?"height":"width";switch(s){case gs:u[h]=u[h]-(t[d]/2-n[d]/2);break;case Wo:u[h]=u[h]+(t[d]/2-n[d]/2);break}}return u}function jo(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=i===void 0?e.placement:i,s=n.strategy,a=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?MC:l,h=n.rootBoundary,d=h===void 0?cb:h,m=n.elementContext,y=m===void 0?po:m,x=n.altBoundary,S=x===void 0?!1:x,C=n.padding,T=C===void 0?0:C,A=pb(typeof T!="number"?T:gb(T,ra)),M=y===po?RC:po,B=e.rects.popper,D=e.elements[S?M:y],R=hO(Rr(D)?D:D.contextElement||Gi(e.elements.popper),u,d,a),N=vs(e.elements.reference),I=vb({reference:N,element:B,placement:r}),j=df(Object.assign({},B,I)),q=y===po?j:N,F={top:R.top-q.top+A.top,bottom:q.bottom-R.bottom+A.bottom,left:R.left-q.left+A.left,right:q.right-R.right+A.right},H=e.modifiersData.offset;if(y===po&&H){var U=H[r];Object.keys(F).forEach(function(V){var st=[Ln,Dn].indexOf(V)>=0?1:-1,tt=[un,Dn].indexOf(V)>=0?"y":"x";F[V]+=U[tt]*st})}return F}function fO(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,h=u===void 0?ub:u,d=bs(i),m=d?l?Og:Og.filter(function(S){return bs(S)===d}):ra,y=m.filter(function(S){return h.indexOf(S)>=0});y.length===0&&(y=m);var x=y.reduce(function(S,C){return S[C]=jo(e,{placement:C,boundary:r,rootBoundary:s,padding:a})[ii(C)],S},{});return Object.keys(x).sort(function(S,C){return x[S]-x[C]})}function dO(e){if(ii(e)===Vf)return[];var t=Jl(e);return[Eg(e),t,Eg(t)]}function pO(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!0:a,u=n.fallbackPlacements,h=n.padding,d=n.boundary,m=n.rootBoundary,y=n.altBoundary,x=n.flipVariations,S=x===void 0?!0:x,C=n.allowedAutoPlacements,T=t.options.placement,A=ii(T),M=A===T,B=u||(M||!S?[Jl(T)]:dO(T)),D=[T].concat(B).reduce(function(xt,Ct){return xt.concat(ii(Ct)===Vf?fO(t,{placement:Ct,boundary:d,rootBoundary:m,padding:h,flipVariations:S,allowedAutoPlacements:C}):Ct)},[]),R=t.rects.reference,N=t.rects.popper,I=new Map,j=!0,q=D[0],F=0;F<D.length;F++){var H=D[F],U=ii(H),V=bs(H)===gs,st=[un,Dn].indexOf(U)>=0,tt=st?"width":"height",it=jo(t,{placement:H,boundary:d,rootBoundary:m,altBoundary:y,padding:h}),K=st?V?Ln:hn:V?Dn:un;R[tt]>N[tt]&&(K=Jl(K));var ct=Jl(K),dt=[];if(s&&dt.push(it[U]<=0),l&&dt.push(it[K]<=0,it[ct]<=0),dt.every(function(xt){return xt})){q=H,j=!1;break}I.set(H,dt)}if(j)for(var _t=S?3:1,wt=function(Ct){var Nt=D.find(function(be){var Ot=I.get(be);if(Ot)return Ot.slice(0,Ct).every(function(St){return St})});if(Nt)return q=Nt,"break"},vt=_t;vt>0;vt--){var Ft=wt(vt);if(Ft==="break")break}t.placement!==q&&(t.modifiersData[i]._skip=!0,t.placement=q,t.reset=!0)}}const gO={name:"flip",enabled:!0,phase:"main",fn:pO,requiresIfExists:["offset"],data:{_skip:!1}};function Mg(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Rg(e){return[un,Ln,Dn,hn].some(function(t){return e[t]>=0})}function mO(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=jo(t,{elementContext:"reference"}),l=jo(t,{altBoundary:!0}),u=Mg(a,i),h=Mg(l,r,s),d=Rg(u),m=Rg(h);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":m})}const vO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:mO};function bO(e,t,n){var i=ii(e),r=[hn,un].indexOf(i)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=s[0],l=s[1];return a=a||0,l=(l||0)*r,[hn,Ln].indexOf(i)>=0?{x:l,y:a}:{x:a,y:l}}function yO(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=r===void 0?[0,0]:r,a=ub.reduce(function(d,m){return d[m]=bO(m,t.rects,s),d},{}),l=a[t.placement],u=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=h),t.modifiersData[i]=a}const _O={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yO};function wO(e){var t=e.state,n=e.name;t.modifiersData[n]=vb({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const xO={name:"popperOffsets",enabled:!0,phase:"read",fn:wO,data:{}};function SO(e){return e==="x"?"y":"x"}function TO(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!1:a,u=n.boundary,h=n.rootBoundary,d=n.altBoundary,m=n.padding,y=n.tether,x=y===void 0?!0:y,S=n.tetherOffset,C=S===void 0?0:S,T=jo(t,{boundary:u,rootBoundary:h,padding:m,altBoundary:d}),A=ii(t.placement),M=bs(t.placement),B=!M,D=Yf(A),R=SO(D),N=t.modifiersData.popperOffsets,I=t.rects.reference,j=t.rects.popper,q=typeof C=="function"?C(Object.assign({},t.rects,{placement:t.placement})):C,F=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(N){if(s){var V,st=D==="y"?un:hn,tt=D==="y"?Dn:Ln,it=D==="y"?"height":"width",K=N[D],ct=K+T[st],dt=K-T[tt],_t=x?-j[it]/2:0,wt=M===gs?I[it]:j[it],vt=M===gs?-j[it]:-I[it],Ft=t.elements.arrow,xt=x&&Ft?Xf(Ft):{width:0,height:0},Ct=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:db(),Nt=Ct[st],be=Ct[tt],Ot=Do(0,I[it],xt[it]),St=B?I[it]/2-_t-Ot-Nt-F.mainAxis:wt-Ot-Nt-F.mainAxis,In=B?-I[it]/2+_t+Ot+be+F.mainAxis:vt+Ot+be+F.mainAxis,De=t.elements.arrow&&sa(t.elements.arrow),te=De?D==="y"?De.clientTop||0:De.clientLeft||0:0,Le=(V=H==null?void 0:H[D])!=null?V:0,re=K+St-Le-te,oe=K+In-Le,we=Do(x?uc(ct,re):ct,K,x?Ar(dt,oe):dt);N[D]=we,U[D]=we-K}if(l){var ye,Ve=D==="x"?un:hn,wn=D==="x"?Dn:Ln,he=N[R],Xt=R==="y"?"height":"width",xe=he+T[Ve],Ae=he-T[wn],xn=[un,hn].indexOf(A)!==-1,Yt=(ye=H==null?void 0:H[R])!=null?ye:0,Se=xn?xe:he-I[Xt]-j[Xt]-Yt+F.altAxis,fe=xn?he+I[Xt]+j[Xt]-Yt-F.altAxis:Ae,Z=x&&xn?YC(Se,he,fe):Do(x?Se:xe,he,x?fe:Ae);N[R]=Z,U[R]=Z-he}t.modifiersData[i]=U}}const CO={name:"preventOverflow",enabled:!0,phase:"main",fn:TO,requiresIfExists:["offset"]};function OO(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function kO(e){return e===_n(e)||!Rn(e)?Kf(e):OO(e)}function AO(e){var t=e.getBoundingClientRect(),n=ms(t.width)/e.offsetWidth||1,i=ms(t.height)/e.offsetHeight||1;return n!==1||i!==1}function EO(e,t,n){n===void 0&&(n=!1);var i=Rn(t),r=Rn(t)&&AO(t),s=Gi(t),a=vs(e,r,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&((si(t)!=="body"||Jf(s))&&(l=kO(t)),Rn(t)?(u=vs(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Gf(s))),{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}function PO(e){var t=new Map,n=new Set,i=[];e.forEach(function(s){t.set(s.name,s)});function r(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&r(u)}}),i.push(s)}return e.forEach(function(s){n.has(s.name)||r(s)}),i}function MO(e){var t=PO(e);return jC.reduce(function(n,i){return n.concat(t.filter(function(r){return r.phase===i}))},[])}function RO(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function DO(e){var t=e.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var Dg={placement:"bottom",modifiers:[],strategy:"absolute"};function Lg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function LO(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,i=n===void 0?[]:n,r=t.defaultOptions,s=r===void 0?Dg:r;return function(l,u,h){h===void 0&&(h=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Dg,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},m=[],y=!1,x={state:d,setOptions:function(A){var M=typeof A=="function"?A(d.options):A;C(),d.options=Object.assign({},s,d.options,M),d.scrollParents={reference:Rr(l)?Lo(l):l.contextElement?Lo(l.contextElement):[],popper:Lo(u)};var B=MO(DO([].concat(i,d.options.modifiers)));return d.orderedModifiers=B.filter(function(D){return D.enabled}),S(),x.update()},forceUpdate:function(){if(!y){var A=d.elements,M=A.reference,B=A.popper;if(Lg(M,B)){d.rects={reference:EO(M,sa(B),d.options.strategy==="fixed"),popper:Xf(B)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(F){return d.modifiersData[F.name]=Object.assign({},F.data)});for(var D=0;D<d.orderedModifiers.length;D++){if(d.reset===!0){d.reset=!1,D=-1;continue}var R=d.orderedModifiers[D],N=R.fn,I=R.options,j=I===void 0?{}:I,q=R.name;typeof N=="function"&&(d=N({state:d,options:j,name:q,instance:x})||d)}}}},update:RO(function(){return new Promise(function(T){x.forceUpdate(),T(d)})}),destroy:function(){C(),y=!0}};if(!Lg(l,u))return x;x.setOptions(h).then(function(T){!y&&h.onFirstUpdate&&h.onFirstUpdate(T)});function S(){d.orderedModifiers.forEach(function(T){var A=T.name,M=T.options,B=M===void 0?{}:M,D=T.effect;if(typeof D=="function"){var R=D({state:d,name:A,instance:x,options:B}),N=function(){};m.push(R||N)}})}function C(){m.forEach(function(T){return T()}),m=[]}return x}}var IO=[rO,xO,nO,VC,_O,gO,CO,ZC,vO],NO=LO({defaultModifiers:IO}),bb=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],hc=bb.join(","),yb=typeof Element>"u",Dr=yb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,pf=!yb&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},_b=function(t,n,i){var r=Array.prototype.slice.apply(t.querySelectorAll(hc));return n&&Dr.call(t,hc)&&r.unshift(t),r=r.filter(i),r},wb=function e(t,n,i){for(var r=[],s=Array.from(t);s.length;){var a=s.shift();if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,h=e(u,!0,i);i.flatten?r.push.apply(r,h):r.push({scope:a,candidates:h})}else{var d=Dr.call(a,hc);d&&i.filter(a)&&(n||!t.includes(a))&&r.push(a);var m=a.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(a),y=!i.shadowRootFilter||i.shadowRootFilter(a);if(m&&y){var x=e(m===!0?a.children:m.children,!0,i);i.flatten?r.push.apply(r,x):r.push({scope:a,candidates:x})}else s.unshift.apply(s,a.children)}}return r},xb=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},FO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sb=function(t){return t.tagName==="INPUT"},BO=function(t){return Sb(t)&&t.type==="hidden"},HO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return n},zO=function(t,n){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===n)return t[i]},WO=function(t){if(!t.name)return!0;var n=t.form||pf(t),i=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=i(window.CSS.escape(t.name));else try{r=i(t.name)}catch(a){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",a.message),!1}var s=zO(r,t.form);return!s||s===t},jO=function(t){return Sb(t)&&t.type==="radio"},$O=function(t){return jO(t)&&!WO(t)},Ig=function(t){var n=t.getBoundingClientRect(),i=n.width,r=n.height;return i===0&&r===0},UO=function(t,n){var i=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Dr.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(Dr.call(a,"details:not([open]) *"))return!0;var l=pf(t).host,u=(l==null?void 0:l.ownerDocument.contains(l))||t.ownerDocument.contains(t);if(!i||i==="full"){if(typeof r=="function"){for(var h=t;t;){var d=t.parentElement,m=pf(t);if(d&&!d.shadowRoot&&r(d)===!0)return Ig(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=h}if(u)return!t.getClientRects().length}else if(i==="non-zero-area")return Ig(t);return!1},VO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var i=0;i<n.children.length;i++){var r=n.children.item(i);if(r.tagName==="LEGEND")return Dr.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},fc=function(t,n){return!(n.disabled||BO(n)||UO(n,t)||HO(n)||VO(n))},gf=function(t,n){return!($O(n)||xb(n)<0||!fc(t,n))},qO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},XO=function e(t){var n=[],i=[];return t.forEach(function(r,s){var a=!!r.scope,l=a?r.scope:r,u=xb(l,a),h=a?e(r.candidates):l;u===0?a?n.push.apply(n,h):n.push(l):i.push({documentOrder:s,tabIndex:u,item:r,isScope:a,content:h})}),i.sort(FO).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},YO=function(t,n){n=n||{};var i;return n.getShadowRoot?i=wb([t],n.includeContainer,{filter:gf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:qO}):i=_b(t,n.includeContainer,gf.bind(null,n)),XO(i)},Tb=function(t,n){n=n||{};var i;return n.getShadowRoot?i=wb([t],n.includeContainer,{filter:fc.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):i=_b(t,n.includeContainer,fc.bind(null,n)),i},Al=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Dr.call(t,hc)===!1?!1:gf(n,t)},KO=bb.concat("iframe").join(","),Zl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Dr.call(t,KO)===!1?!1:fc(n,t)};function Ng(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Fg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ng(Object(n),!0).forEach(function(i){GO(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ng(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function GO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bg=function(){var e=[];return{activateTrap:function(n){if(e.length>0){var i=e[e.length-1];i!==n&&i.pause()}var r=e.indexOf(n);r===-1||e.splice(r,1),e.push(n)},deactivateTrap:function(n){var i=e.indexOf(n);i!==-1&&e.splice(i,1),e.length>0&&e[e.length-1].unpause()}}}(),JO=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},ZO=function(t){return t.key==="Escape"||t.key==="Esc"||t.keyCode===27},QO=function(t){return t.key==="Tab"||t.keyCode===9},Hg=function(t){return setTimeout(t,0)},zg=function(t,n){var i=-1;return t.every(function(r,s){return n(r)?(i=s,!1):!0}),i},go=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return typeof t=="function"?t.apply(void 0,i):t},El=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},tk=function(t,n){var i=(n==null?void 0:n.document)||document,r=Fg({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},a,l=function(N,I,j){return N&&N[I]!==void 0?N[I]:r[j||I]},u=function(N){return s.containerGroups.findIndex(function(I){var j=I.container,q=I.tabbableNodes;return j.contains(N)||q.find(function(F){return F===N})})},h=function(N){var I=r[N];if(typeof I=="function"){for(var j=arguments.length,q=new Array(j>1?j-1:0),F=1;F<j;F++)q[F-1]=arguments[F];I=I.apply(void 0,q)}if(I===!0&&(I=void 0),!I){if(I===void 0||I===!1)return I;throw new Error("`".concat(N,"` was specified but was not a node, or did not return a node"))}var H=I;if(typeof I=="string"&&(H=i.querySelector(I),!H))throw new Error("`".concat(N,"` as selector refers to no known node"));return H},d=function(){var N=h("initialFocus");if(N===!1)return!1;if(N===void 0)if(u(i.activeElement)>=0)N=i.activeElement;else{var I=s.tabbableGroups[0],j=I&&I.firstTabbableNode;N=j||h("fallbackFocus")}if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},m=function(){if(s.containerGroups=s.containers.map(function(N){var I=YO(N,r.tabbableOptions),j=Tb(N,r.tabbableOptions);return{container:N,tabbableNodes:I,focusableNodes:j,firstTabbableNode:I.length>0?I[0]:null,lastTabbableNode:I.length>0?I[I.length-1]:null,nextTabbableNode:function(F){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,U=j.findIndex(function(V){return V===F});if(!(U<0))return H?j.slice(U+1).find(function(V){return Al(V,r.tabbableOptions)}):j.slice(0,U).reverse().find(function(V){return Al(V,r.tabbableOptions)})}}}),s.tabbableGroups=s.containerGroups.filter(function(N){return N.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},y=function R(N){if(N!==!1&&N!==i.activeElement){if(!N||!N.focus){R(d());return}N.focus({preventScroll:!!r.preventScroll}),s.mostRecentlyFocusedNode=N,JO(N)&&N.select()}},x=function(N){var I=h("setReturnFocus",N);return I||(I===!1?!1:N)},S=function(N){var I=El(N);if(!(u(I)>=0)){if(go(r.clickOutsideDeactivates,N)){a.deactivate({returnFocus:r.returnFocusOnDeactivate&&!Zl(I,r.tabbableOptions)});return}go(r.allowOutsideClick,N)||N.preventDefault()}},C=function(N){var I=El(N),j=u(I)>=0;j||I instanceof Document?j&&(s.mostRecentlyFocusedNode=I):(N.stopImmediatePropagation(),y(s.mostRecentlyFocusedNode||d()))},T=function(N){var I=El(N);m();var j=null;if(s.tabbableGroups.length>0){var q=u(I),F=q>=0?s.containerGroups[q]:void 0;if(q<0)N.shiftKey?j=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:j=s.tabbableGroups[0].firstTabbableNode;else if(N.shiftKey){var H=zg(s.tabbableGroups,function(K){var ct=K.firstTabbableNode;return I===ct});if(H<0&&(F.container===I||Zl(I,r.tabbableOptions)&&!Al(I,r.tabbableOptions)&&!F.nextTabbableNode(I,!1))&&(H=q),H>=0){var U=H===0?s.tabbableGroups.length-1:H-1,V=s.tabbableGroups[U];j=V.lastTabbableNode}}else{var st=zg(s.tabbableGroups,function(K){var ct=K.lastTabbableNode;return I===ct});if(st<0&&(F.container===I||Zl(I,r.tabbableOptions)&&!Al(I,r.tabbableOptions)&&!F.nextTabbableNode(I))&&(st=q),st>=0){var tt=st===s.tabbableGroups.length-1?0:st+1,it=s.tabbableGroups[tt];j=it.firstTabbableNode}}}else j=h("fallbackFocus");j&&(N.preventDefault(),y(j))},A=function(N){if(ZO(N)&&go(r.escapeDeactivates,N)!==!1){N.preventDefault(),a.deactivate();return}if(QO(N)){T(N);return}},M=function(N){var I=El(N);u(I)>=0||go(r.clickOutsideDeactivates,N)||go(r.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},B=function(){if(s.active)return Bg.activateTrap(a),s.delayInitialFocusTimer=r.delayInitialFocus?Hg(function(){y(d())}):y(d()),i.addEventListener("focusin",C,!0),i.addEventListener("mousedown",S,{capture:!0,passive:!1}),i.addEventListener("touchstart",S,{capture:!0,passive:!1}),i.addEventListener("click",M,{capture:!0,passive:!1}),i.addEventListener("keydown",A,{capture:!0,passive:!1}),a},D=function(){if(s.active)return i.removeEventListener("focusin",C,!0),i.removeEventListener("mousedown",S,!0),i.removeEventListener("touchstart",S,!0),i.removeEventListener("click",M,!0),i.removeEventListener("keydown",A,!0),a};return a={get active(){return s.active},get paused(){return s.paused},activate:function(N){if(s.active)return this;var I=l(N,"onActivate"),j=l(N,"onPostActivate"),q=l(N,"checkCanFocusTrap");q||m(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=i.activeElement,I&&I();var F=function(){q&&m(),B(),j&&j()};return q?(q(s.containers.concat()).then(F,F),this):(F(),this)},deactivate:function(N){if(!s.active)return this;var I=Fg({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},N);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,D(),s.active=!1,s.paused=!1,Bg.deactivateTrap(a);var j=l(I,"onDeactivate"),q=l(I,"onPostDeactivate"),F=l(I,"checkCanReturnFocus"),H=l(I,"returnFocus","returnFocusOnDeactivate");j&&j();var U=function(){Hg(function(){H&&y(x(s.nodeFocusedBeforeActivation)),q&&q()})};return H&&F?(F(x(s.nodeFocusedBeforeActivation)).then(U,U),this):(U(),this)},pause:function(){return s.paused||!s.active?this:(s.paused=!0,D(),this)},unpause:function(){return!s.paused||!s.active?this:(s.paused=!1,m(),B(),this)},updateContainerElements:function(N){var I=[].concat(N).filter(Boolean);return s.containers=I.map(function(j){return typeof j=="string"?i.querySelector(j):j}),s.active&&m(),this}},a.updateContainerElements(t),a};function ek(e){let t,n;window.addEventListener("focusin",()=>{t=n,n=document.activeElement}),e.magic("focus",i=>{let r=i;return{__noscroll:!1,__wrapAround:!1,within(s){return r=s,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(s){return Zl(s)},previouslyFocused(){return t},lastFocused(){return t},focused(){return n},focusables(){return Array.isArray(r)?r:Tb(r,{displayCheck:"none"})},all(){return this.focusables()},isFirst(s){let a=this.all();return a[0]&&a[0].isSameNode(s)},isLast(s){let a=this.all();return a.length&&a.slice(-1)[0].isSameNode(s)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let s=this.all(),a=document.activeElement;if(s.indexOf(a)!==-1)return this.__wrapAround&&s.indexOf(a)===s.length-1?s[0]:s[s.indexOf(a)+1]},getPrevious(){let s=this.all(),a=document.activeElement;if(s.indexOf(a)!==-1)return this.__wrapAround&&s.indexOf(a)===0?s.slice(-1)[0]:s[s.indexOf(a)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(s){s&&setTimeout(()=>{s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.focus({preventScroll:this.__noscroll})})}}}),e.directive("trap",e.skipDuringClone((i,{expression:r,modifiers:s},{effect:a,evaluateLater:l,cleanup:u})=>{let h=l(r),d=!1,m={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>i};if(s.includes("noautofocus"))m.initialFocus=!1;else{let T=i.querySelector("[autofocus]");T&&(m.initialFocus=T)}let y=tk(i,m),x=()=>{},S=()=>{};const C=()=>{x(),x=()=>{},S(),S=()=>{},y.deactivate({returnFocus:!s.includes("noreturn")})};a(()=>h(T=>{d!==T&&(T&&!d&&(s.includes("noscroll")&&(S=nk()),s.includes("inert")&&(x=Wg(i)),setTimeout(()=>{y.activate()},15)),!T&&d&&C(),d=!!T)})),u(C)},(i,{expression:r,modifiers:s},{evaluate:a})=>{s.includes("inert")&&a(r)&&Wg(i)}))}function Wg(e){let t=[];return Cb(e,n=>{let i=n.hasAttribute("aria-hidden");n.setAttribute("aria-hidden","true"),t.push(()=>i||n.removeAttribute("aria-hidden"))}),()=>{for(;t.length;)t.pop()()}}function Cb(e,t){e.isSameNode(document.body)||!e.parentNode||Array.from(e.parentNode.children).forEach(n=>{n.isSameNode(e)?Cb(e.parentNode,t):t(n)})}function nk(){let e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${n}px`,()=>{document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}var ik=ek;/*! Bundled license information:
tabbable/dist/index.esm.js:
(*!
* tabbable 5.3.3
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*)
focus-trap/dist/focus-trap.esm.js:
(*!
* focus-trap 6.9.4
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*)
*/var jg="&#8203;";function Lh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function $g(e){return function(t){if(Array.isArray(t))return Lh(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return Lh(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Lh(t,n)}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var qi={isEnabled:function(){var e;return(e=window.TAGIFY_DEBUG)===null||e===void 0||e},log:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i;this.isEnabled()&&(i=console).log.apply(i,["[Tagify]:"].concat($g(t)))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i;this.isEnabled()&&(i=console).warn.apply(i,["[Tagify]:"].concat($g(t)))}},To=function(e,t,n,i){return e=""+e,t=""+t,i&&(e=e.trim(),t=t.trim()),n?e==t:e.toLowerCase()==t.toLowerCase()},Ug=function(e,t){return e&&Array.isArray(e)&&e.map(function(n){return mf(n,t)})};function mf(e,t){var n,i={};for(n in e)t.indexOf(n)<0&&(i[n]=e[n]);return i}function Ih(e){return new DOMParser().parseFromString(e.trim(),"text/html").body.firstElementChild}function Vg(e,t){for(t=t||"previous";e=e[t+"Sibling"];)if(e.nodeType==3)return e}function wr(e){return typeof e=="string"?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/`|'/g,"&#039;"):e}function Wn(e){var t=Object.prototype.toString.call(e).split(" ")[1].slice(0,-1);return e===Object(e)&&t!="Array"&&t!="Function"&&t!="RegExp"&&t!="HTMLUnknownElement"}function Oe(e,t,n){var i,r;function s(a,l){for(var u in l)if(l.hasOwnProperty(u)){if(Wn(l[u])){Wn(a[u])?s(a[u],l[u]):a[u]=Object.assign({},l[u]);continue}if(Array.isArray(l[u])){a[u]=Object.assign([],l[u]);continue}a[u]=l[u]}}return i=e,((r=Object)!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?r[Symbol.hasInstance](i):i instanceof r)||(e={}),s(e,t),n&&s(e,n),e}function qg(){var e=[],t={},n=!0,i=!1,r=void 0;try{for(var s,a=arguments[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value,u=!0,h=!1,d=void 0;try{for(var m,y=l[Symbol.iterator]();!(u=(m=y.next()).done);u=!0){var x=m.value;Wn(x)?t[x.value]||(e.push(x),t[x.value]=1):e.includes(x)||e.push(x)}}catch(S){h=!0,d=S}finally{try{u||y.return==null||y.return()}finally{if(h)throw d}}}}catch(S){i=!0,r=S}finally{try{n||a.return==null||a.return()}finally{if(i)throw r}}return e}function Pl(e){return String.prototype.normalize?typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:e}var Xg=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function Yg(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})}function Tr(e){var t,n=Ob.call(this,e),i=e==null||(t=e.classList)===null||t===void 0?void 0:t.contains(this.settings.classNames.tag);return n&&i}function Kg(e){return Ob.call(this,e)&&(e==null?void 0:e.closest(this.settings.classNames.tagSelector))}function Ob(e){var t;return(e==null||(t=e.closest)===null||t===void 0?void 0:t.call(e,this.settings.classNames.namespaceSelector))===this.DOM.scope}function kb(e,t){var n=window.getSelection();return t=t||n.getRangeAt(0),typeof e=="string"&&(e=document.createTextNode(e)),t&&(t.deleteContents(),t.insertNode(e)),e}function Zt(e,t,n){return e?(t&&(e.__tagifyTagData=n?t:Oe({},e.__tagifyTagData||{},t)),e.__tagifyTagData):(qi.warn("tag element doesn't exist",{tagElm:e,data:t}),t)}function Wi(e){if(e&&e.parentNode){var t=e,n=window.getSelection(),i=n.getRangeAt(0);n.rangeCount&&(i.setStartAfter(t),i.collapse(!0),n.removeAllRanges(),n.addRange(i))}}function Ab(e,t){e.forEach(function(n){if(Zt(n.previousSibling)||!n.previousSibling){var i=document.createTextNode("​");n.before(i),t&&Wi(i)}})}var Nh={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,focusInputOnRemove:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function rk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){rk(e,r,n[r])})}return e}function ok(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(n,i){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);r.push.apply(r,s)}return r}(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Fh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function ak(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lk(e){return function(t){if(Array.isArray(t))return Fh(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return Fh(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Fh(t,n)}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ck(){for(var e in this.dropdown={},this._dropdown)this.dropdown[e]=typeof this._dropdown[e]=="function"?this._dropdown[e].bind(this):this._dropdown[e];this.dropdown.refs(),this.DOM.dropdown.__tagify=this}var Ml,as,uk=(Ml=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){ak(e,r,n[r])})}return e}({},{events:{binding:function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=this.dropdown.events.callbacks,n=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:t.onKeyDown.bind(this),onMouseOver:t.onMouseOver.bind(this),onMouseLeave:t.onMouseLeave.bind(this),onClick:t.onClick.bind(this),onScroll:t.onScroll.bind(this)},i=e?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[i]("scroll",n.position,!0),window[i]("resize",n.position),window[i]("keydown",n.onKeyDown)),this.DOM.dropdown[i]("mouseover",n.onMouseOver),this.DOM.dropdown[i]("mouseleave",n.onMouseLeave),this.DOM.dropdown[i]("mousedown",n.onClick),this.DOM.dropdown.content[i]("scroll",n.onScroll)},callbacks:{onKeyDown:function(e){var t=this;if(this.state.hasFocus&&!this.state.composing){var n=this.settings,i=n.dropdown.includeSelectedTags,r=this.DOM.dropdown.querySelector(n.classNames.dropdownItemActiveSelector),s=this.dropdown.getSuggestionDataByNode(r),a=n.mode=="mix",l=n.mode=="select";n.hooks.beforeKeyDown(e,{tagify:this}).then(function(u){switch(e.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":e.preventDefault();var h=t.dropdown.getAllSuggestionsRefs(),d=e.key=="ArrowUp"||e.key=="Up";r&&(r=t.dropdown.getNextOrPrevOption(r,!d)),r&&r.matches(n.classNames.dropdownItemSelector)||(r=h[d?h.length-1:0]),t.dropdown.highlightOption(r,!0);break;case"PageUp":case"PageDown":var m;e.preventDefault();var y=t.dropdown.getAllSuggestionsRefs(),x=Math.floor(t.DOM.dropdown.content.clientHeight/((m=y[0])===null||m===void 0?void 0:m.offsetHeight))||1,S=e.key==="PageUp";if(r){var C=y.indexOf(r),T=S?Math.max(0,C-x):Math.min(y.length-1,C+x);r=y[T]}else r=y[0];t.dropdown.highlightOption(r,!0);break;case"Home":case"End":e.preventDefault();var A=t.dropdown.getAllSuggestionsRefs();r=A[e.key==="Home"?0:A.length-1],t.dropdown.highlightOption(r,!0);break;case"Escape":case"Esc":t.dropdown.hide();break;case"ArrowRight":if(t.state.actions.ArrowLeft||n.autoComplete.rightKey)return;case"Tab":var M=!n.autoComplete.rightKey||!n.autoComplete.tabKey;if(!a&&!l&&r&&M&&!t.state.editing&&s){e.preventDefault();var B=t.dropdown.getMappedValue(s);return t.state.autoCompleteData=s,t.input.autocomplete.set.call(t,B),!1}return!0;case"Enter":e.preventDefault(),t.state.actions.selectOption=!0,setTimeout(function(){return t.state.actions.selectOption=!1},100),n.hooks.suggestionClick(e,{tagify:t,tagData:s,suggestionElm:r}).then(function(){if(r){var R=i?r:t.dropdown.getNextOrPrevOption(r,!d);t.dropdown.selectOption(r,e,function(){if(R){var N=R.getAttribute("value");R=t.dropdown.getSuggestionNodeByValue(N),t.dropdown.highlightOption(R)}})}else t.dropdown.hide(),a||t.addTags(t.state.inputText.trim(),!0)}).catch(function(R){return qi.warn(R)});break;case"Backspace":if(a||t.state.editing.scope)return;var D=t.input.raw.call(t);D!=""&&D.charCodeAt(0)!=8203||(n.backspace===!0?t.removeTags():n.backspace=="edit"&&setTimeout(t.editTag.bind(t),0))}})}},onMouseOver:function(e){var t=e.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(t)},onMouseLeave:function(e){this.dropdown.highlightOption()},onClick:function(e){var t=this;if(e.button==0&&e.target!=this.DOM.dropdown&&e.target!=this.DOM.dropdown.content){var n=e.target.closest(this.settings.classNames.dropdownItemSelector),i=this.dropdown.getSuggestionDataByNode(n);this.state.actions.selectOption=!0,setTimeout(function(){return t.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(e,{tagify:this,tagData:i,suggestionElm:n}).then(function(){n?t.dropdown.selectOption(n,e):t.dropdown.hide()}).catch(function(r){return qi.warn(r)})}},onScroll:function(e){var t=e.target,n=t.scrollTop/(t.scrollHeight-t.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(n)})}}},refilter:function(e){e=e||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(e),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(e){for(var t,n=e&&e.getAttribute("value"),i=this.suggestedListItems.length;i--;){if(Wn(t=this.suggestedListItems[i])&&t.value==n)return t;if(t==n)return{value:t}}},getSuggestionNodeByValue:function(e){return this.dropdown.getAllSuggestionsRefs().find(function(t){return t.getAttribute("value")===e})},getNextOrPrevOption:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.dropdown.getAllSuggestionsRefs(),i=n.findIndex(function(r){return r===e});return t?n[i+1]:n[i-1]},highlightOption:function(e,t){var n,i=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(i),this.state.ddItemElm.removeAttribute("aria-selected")),!e)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);n=this.dropdown.getSuggestionDataByNode(e),this.state.ddItemData=n,this.state.ddItemElm=e,e.classList.add(i),e.setAttribute("aria-selected",!0),t&&(e.parentNode.scrollTop=e.clientHeight+e.offsetTop-e.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,n),this.dropdown.position())},selectOption:function(e,t,n){var i=this,r=this.settings,s=r.dropdown.includeSelectedTags,a=r.dropdown,l=a.clearOnSelect,u=a.closeOnSelect;if(!e)return this.addTags(this.state.inputText,!0),void(u&&this.dropdown.hide());t=t||{};var h=e.getAttribute("value"),d=h=="noMatch",m=r.mode=="mix",y=this.suggestedListItems.find(function(S){var C;return((C=S.value)!==null&&C!==void 0?C:S)==h});if(this.trigger("dropdown:select",{data:y,elm:e,event:t}),y||d){if(this.state.editing){var x=this.normalizeTags([y])[0];y=r.transformTag.call(this,x)||x,this.onEditTagDone(null,Oe({__isValid:!0},y))}else this[m?"addMixTags":"addTags"]([y||this.input.raw.call(this)],l);(m||this.DOM.input.parentNode)&&(setTimeout(function(){i.DOM.input.focus(),i.toggleFocusClass(!0)}),u&&setTimeout(this.dropdown.hide.bind(this)),s?n&&n():(e.addEventListener("transitionend",function(){i.dropdown.fillHeaderFooter(),setTimeout(function(){e.remove(),i.dropdown.refilter(),n&&n()},100)},{once:!0}),e.classList.add(this.settings.classNames.dropdownItemHidden)))}else u&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(e){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var t=this.dropdown.filterListItems("");return e||(t=this.state.dropdown.suggestions),this.addTags(t,!0),this},filterListItems:function(e,t){var n,i,r,s,a,l,u=function(){var R,N,I=void 0,j=void 0;R=S[B],i=((N=Object)!=null&&typeof Symbol<"u"&&N[Symbol.hasInstance]?N[Symbol.hasInstance](R):R instanceof N)?S[B]:{value:S[B]};var q,F=Object.keys(i).some(function(H){return M.includes(H)})?M:["value"];m.fuzzySearch&&!t.exact?(s=F.reduce(function(H,U){return H+" "+(i[U]||"")},"").toLowerCase().trim(),m.accentedSearch&&(s=Pl(s),l=Pl(l)),I=s.indexOf(l)==0,j=s===l,q=s,r=l.toLowerCase().split(" ").every(function(H){return q.includes(H.toLowerCase())})):(I=!0,r=F.some(function(H){var U=""+(i[H]||"");return m.accentedSearch&&(U=Pl(U),l=Pl(l)),m.caseSensitive||(U=U.toLowerCase()),j=U===l,t.exact?U===l:U.indexOf(l)==0})),a=!m.includeSelectedTags&&n.isTagDuplicate(Wn(i)?i.value:i),r&&!a&&(j&&I?x.push(i):m.sortby=="startsWith"&&I?y.unshift(i):y.push(i))},h=this,d=this.settings,m=d.dropdown,y=(t=t||{},[]),x=[],S=d.whitelist,C=m.maxItems>=0?m.maxItems:1/0,T=m.includeSelectedTags,A=typeof m.sortby=="function",M=m.searchKeys,B=0;if(!(e=d.mode=="select"&&this.value.length&&this.value[0][d.tagTextProp]==e?"":e)||!M.length){y=T?S:S.filter(function(R){return!h.isTagDuplicate(Wn(R)?R.value:R)});var D=A?m.sortby(y,l):y.slice(0,C);return this.state.dropdown.suggestions=D,D}for(l=m.caseSensitive?""+e:(""+e).toLowerCase();B<S.length;B++)n=this,u();return this.state.dropdown.suggestions=x.concat(y),D=A?m.sortby(x.concat(y),l):x.concat(y).slice(0,C),this.state.dropdown.suggestions=D,D},getMappedValue:function(e){var t=this.settings.dropdown.mapValueTo;return t?typeof t=="function"?t(e):e[t]||e.value:e.value},createListHTML:function(e){var t=this;return Oe([],e).map(function(n,i){typeof n!="string"&&typeof n!="number"||(n={value:n});var r=t.dropdown.getMappedValue(n);return r=typeof r=="string"&&t.settings.dropdown.escapeHTML?wr(r):r,t.settings.templates.dropdownItem.apply(t,[ok(sk({},n),{mappedValue:r}),t])}).join("")}}),as=(as={refs:function(){this.DOM.dropdown=this.parseTemplate("dropdown",[this.settings]),this.DOM.dropdown.content=this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']")},getHeaderRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-header']")},getFooterRef:function(){return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']")},getAllSuggestionsRefs:function(){return lk(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector))},show:function(e){var t,n,i,r=this,s=this.settings,a=s.mode=="mix"&&!s.enforceWhitelist,l=!s.whitelist||!s.whitelist.length,u=s.dropdown.position=="manual";if(e=e===void 0?this.state.inputText:e,!(l&&!a&&!s.templates.dropdownItemNoMatch||s.dropdown.enabled===!1||this.state.isLoading||this.settings.readonly)){if(clearTimeout(this.dropdownHide__bindEventsTimeout),this.suggestedListItems=this.dropdown.filterListItems(e),e&&!this.suggestedListItems.length&&(this.trigger("dropdown:noMatch",e),s.templates.dropdownItemNoMatch&&(i=s.templates.dropdownItemNoMatch.call(this,{value:e}))),!i){if(this.suggestedListItems.length)e&&a&&!this.state.editing.scope&&!To(this.suggestedListItems[0].value,e)&&this.suggestedListItems.unshift({value:e});else{if(!e||!a||this.state.editing.scope)return this.input.autocomplete.suggest.call(this),void this.dropdown.hide();this.suggestedListItems=[{value:e}]}n=""+(Wn(t=this.suggestedListItems[0])?t.value:t),s.autoComplete&&n&&n.indexOf(e)==0&&this.input.autocomplete.suggest.call(this,t)}this.dropdown.fill(i),s.dropdown.highlightFirst&&this.dropdown.highlightOption(this.DOM.dropdown.content.querySelector(s.classNames.dropdownItemSelector)),this.state.dropdown.visible||setTimeout(this.dropdown.events.binding.bind(this)),this.state.dropdown.visible=e||!0,this.state.dropdown.query=e,this.setStateSelection(),u||setTimeout(function(){r.dropdown.position(),r.dropdown.render()}),setTimeout(function(){r.trigger("dropdown:show",r.DOM.dropdown)})}},hide:function(e){var t=this,n=this.DOM,i=n.scope,r=n.dropdown,s=this.settings.dropdown.position=="manual"&&!e;if(r&&document.body.contains(r)&&!s)return window.removeEventListener("resize",this.dropdown.position),this.dropdown.events.binding.call(this,!1),i.setAttribute("aria-expanded",!1),r.parentNode.removeChild(r),setTimeout(function(){t.state.dropdown.visible=!1},100),this.state.dropdown.query=this.state.ddItemData=this.state.ddItemElm=this.state.selection=null,this.state.tag&&this.state.tag.value.length&&(this.state.flaggedTags[this.state.tag.baseOffset]=this.state.tag),this.trigger("dropdown:hide",r),this},toggle:function(e){this.dropdown[this.state.dropdown.visible&&!e?"hide":"show"]()},getAppendTarget:function(){var e=this.settings.dropdown;return typeof e.appendTarget=="function"?e.appendTarget():e.appendTarget},render:function(){var e,t,n,i=this,r=(e=this.DOM.dropdown,(n=e.cloneNode(!0)).style.cssText="position:fixed; top:-9999px; opacity:0",document.body.appendChild(n),t=n.clientHeight,n.parentNode.removeChild(n),t),s=this.settings,a=this.dropdown.getAppendTarget();return s.dropdown.enabled===!1||(this.DOM.scope.setAttribute("aria-expanded",!0),document.body.contains(this.DOM.dropdown)||(this.DOM.dropdown.classList.add(s.classNames.dropdownInital),this.dropdown.position(r),a.appendChild(this.DOM.dropdown),setTimeout(function(){return i.DOM.dropdown.classList.remove(s.classNames.dropdownInital)}))),this},fill:function(e){e=typeof e=="string"?e:this.dropdown.createListHTML(e||this.suggestedListItems);var t,n=this.settings.templates.dropdownContent.call(this,e);this.DOM.dropdown.content.innerHTML=(t=n)?t.replace(/\>[\r\n ]+\</g,"><").split(/>\s+</).join("><").trim():""},fillHeaderFooter:function(){var e=this.dropdown.filterListItems(this.state.dropdown.query),t=this.parseTemplate("dropdownHeader",[e]),n=this.parseTemplate("dropdownFooter",[e]),i=this.dropdown.getHeaderRef(),r=this.dropdown.getFooterRef();t&&(i==null||i.parentNode.replaceChild(t,i)),n&&(r==null||r.parentNode.replaceChild(n,r))},position:function(e){var t=this.settings.dropdown,n=this.dropdown.getAppendTarget();if(t.position!="manual"&&n){var i,r,s,a,l,u,h,d,m,y,x=this.DOM.dropdown,S=t.RTL,C=n===document.body,T=n===this.DOM.scope,A=C?window.pageYOffset:n.scrollTop,M=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,B=M.clientHeight,D=Math.max(M.clientWidth||0,window.innerWidth||0),R=D>480?t.position:"all",N=this.DOM[R=="input"?"input":"scope"];if(e=e||x.clientHeight,this.state.dropdown.visible){if(R=="text"?(s=(i=function(){var q=document.getSelection();if(q.rangeCount){var F,H,U=q.getRangeAt(0),V=U.startContainer,st=U.startOffset;if(st>0)return(H=document.createRange()).setStart(V,st-1),H.setEnd(V,st),{left:(F=H.getBoundingClientRect()).right,top:F.top,bottom:F.bottom};if(V.getBoundingClientRect)return V.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,r=i.top,a=i.left,l="auto"):(u=function(q){var F=0,H=0;for(q=q.parentNode;q&&q!=M;)F+=q.offsetTop||0,H+=q.offsetLeft||0,q=q.parentNode;return{top:F,left:H}}(n),i=N.getBoundingClientRect(),r=T?-1:i.top-u.top,s=(T?i.height:i.bottom-u.top)-1,a=T?-1:i.left-u.left,l=i.width+"px"),!C){var I=function(){for(var q=0,F=t.appendTarget.parentNode;F;)q+=F.scrollTop||0,F=F.parentNode;return q}();r+=I,s+=I}var j;r=Math.floor(r),s=Math.ceil(s),d=D-a<120,m=((h=(j=t.placeAbove)!==null&&j!==void 0?j:B-i.bottom<e)?r:s)+A,y=a+(S&&i.width||0)+window.pageXOffset,y=R=="text"&&d?"right: 0;":"left: ".concat(y,"px;"),x.style.cssText="".concat(y," top: ").concat(m,"px; min-width: ").concat(l,"; max-width: ").concat(l),x.setAttribute("placement",h?"top":"bottom"),x.setAttribute("position",R)}}}})!=null?as:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Ml,Object.getOwnPropertyDescriptors(as)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n.push.apply(n,i)}return n}(Object(as)).forEach(function(e){Object.defineProperty(Ml,e,Object.getOwnPropertyDescriptor(as,e))}),Ml),mo="@yaireo/tagify/",hk={empty:"empty",exceed:"number of tags exceeded",pattern:"pattern mismatch",duplicate:"already exists",notAllowed:"not allowed"},fk={wrapper:function(e,t){return'<tags class="'.concat(t.classNames.namespace," ").concat(t.mode?"".concat(t.classNames[t.mode+"Mode"]):""," ").concat(e.className,`"
`).concat(t.readonly?"readonly":"",`
`).concat(t.disabled?"disabled":"",`
`).concat(t.required?"required":"",`
`).concat(t.mode==="select"?"spellcheck='false'":"",`
tabIndex="-1">
`).concat(this.settings.templates.input.call(this),`
`).concat(jg,`
</tags>`)},input:function(){var e=this.settings,t=e.placeholder||jg;return"<span ".concat(!e.readonly&&e.userInput?"contenteditable":"",' data-can-editable tabIndex="0" data-placeholder="').concat(t,'" aria-placeholder="').concat(e.placeholder||"",`"
class="`).concat(e.classNames.input,`"
role="textbox"
autocapitalize="false"
autocorrect="off"
aria-autocomplete="both"
aria-multiline="`).concat(e.mode=="mix",'"></span>')},tag:function(e,t){var n=t.settings;return'<tag title="'.concat(e.title||e.value,`"
contenteditable='false'
tabIndex="`).concat(n.a11y.focusableTags?0:-1,`"
class="`).concat(n.classNames.tag," ").concat(e.class||"",`"
`).concat(this.getAttributes(e),`>
<x title='' tabIndex="`).concat(n.a11y.focusableTags?0:-1,'" class="').concat(n.classNames.tagX,`" role='button' aria-label='remove tag'></x>
<div>
<span `).concat(n.mode==="select"&&n.userInput?"contenteditable='true'":"",` autocapitalize="false" autocorrect="off" spellcheck='false' class="`).concat(n.classNames.tagText,'">').concat(e[n.tagTextProp]||e.value,`</span>
</div>
</tag>`)},dropdown:function(e){var t=e.dropdown,n=t.position=="manual";return'<div class="'.concat(n?"":e.classNames.dropdown," ").concat(t.classname,'" role="listbox" aria-labelledby="dropdown" dir="').concat(t.RTL?"rtl":"",`">
<div data-selector='tagify-suggestions-wrapper' class="`).concat(e.classNames.dropdownWrapper,`"></div>
</div>`)},dropdownContent:function(e){var t=this.settings.templates,n=this.state.dropdown.suggestions;return`
`.concat(t.dropdownHeader.call(this,n),`
`).concat(e,`
`).concat(t.dropdownFooter.call(this,n),`
`)},dropdownItem:function(e){return"<div ".concat(this.getAttributes(e),`
class='`).concat(this.settings.classNames.dropdownItem," ").concat(this.isTagDuplicate(e.value)?this.settings.classNames.dropdownItemSelected:""," ").concat(e.class||"",`'
tabindex="0"
role="option">`).concat(e.mappedValue||e.value,"</div>")},dropdownHeader:function(e){return`<header data-selector='tagify-suggestions-header' class="`.concat(this.settings.classNames.dropdownHeader,'"></header>')},dropdownFooter:function(e){var t=e.length-this.settings.dropdown.maxItems;return t>0?`<footer data-selector='tagify-suggestions-footer' class="`.concat(this.settings.classNames.dropdownFooter,`">
`).concat(t,` more items. Refine your search.
</footer>`):""},dropdownItemNoMatch:null};function Gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Jg(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function dk(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,i){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var s,a,l=[],u=!0,h=!1;try{for(r=r.call(n);!(u=(s=r.next()).done)&&(l.push(s.value),!i||l.length!==i);u=!0);}catch(d){h=!0,a=d}finally{try{u||r.return==null||r.return()}finally{if(h)throw a}}return l}}(e,t)||function(n,i){if(n){if(typeof n=="string")return Gg(n,i);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gg(n,i)}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zg(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function pk(e,t){return t=t??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(n,i){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);r.push.apply(r,s)}return r}(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Hh(e){return function(t){if(Array.isArray(t))return Bh(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return Bh(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Bh(t,n)}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gk={customBinding:function(){var e=this;this.customEventsList.forEach(function(t){e.on(t,e.settings.callbacks[t])})},binding:function(){var e,t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],n=this.settings,i=this.events.callbacks,r=t?"addEventListener":"removeEventListener";if(!(this.state.mainEvents&&t||n.disabled||n.readonly)){for(var s in this.state.mainEvents=t,t&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{keydown:["input",i.onKeydown.bind(this)],click:["scope",i.onClickScope.bind(this)],dblclick:n.mode!="select"&&["scope",i.onDoubleClickScope.bind(this)],paste:["input",i.onPaste.bind(this)],drop:["input",i.onDrop.bind(this)],compositionstart:["input",i.onCompositionStart.bind(this)],compositionend:["input",i.onCompositionEnd.bind(this)]})e[s]&&this.DOM[e[s][0]][r](s,e[s][1]);var a=this.listeners.main.inputMutationObserver||new MutationObserver(i.onInputDOMChange.bind(this));a.disconnect(),n.mode=="mix"&&a.observe(this.DOM.input,{childList:!0}),this.events.bindOriginaInputListener.call(this)}},bindOriginaInputListener:function(e){var t=(e||0)+500;this.listeners.main&&(clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(this.events.callbacks.observeOriginalInputValue.bind(this),t))},bindGlobal:function(e){var t,n=this.events.callbacks,i=e?"removeEventListener":"addEventListener";if(this.listeners&&(e||!this.listeners.global)){this.listeners.global=this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:n[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:n.onWindowKeyDown.bind(this)},{type:"focusin",target:this.DOM.scope,cb:n.onFocusBlur.bind(this)},{type:"focusout",target:this.DOM.scope,cb:n.onFocusBlur.bind(this)},{type:"click",target:document,cb:n.onClickAnywhere.bind(this),useCapture:!0}];var r=!0,s=!1,a=void 0;try{for(var l,u=this.listeners.global[Symbol.iterator]();!(r=(l=u.next()).done);r=!0)(t=l.value).target[i](t.type,t.cb,!!t.useCapture)}catch(h){s=!0,a=h}finally{try{r||u.return==null||u.return()}finally{if(s)throw a}}}},unbindGlobal:function(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur:function(e){var t,n,i=this.settings,r=Kg.call(this,e.relatedTarget),s=Tr.call(this,e.target),a=e.target.classList.contains(i.classNames.tagX),l=e.type=="focusin",u=e.type=="focusout";a&&i.mode!="mix"&&i.focusInputOnRemove&&this.DOM.input.focus(),r&&l&&!s&&!a&&this.toggleFocusClass(this.state.hasFocus=+new Date);var h=e.target?this.trim(this.DOM.input.textContent):"",d=(n=this.value)===null||n===void 0||(t=n[0])===null||t===void 0?void 0:t[i.tagTextProp],m=i.dropdown.enabled>=0,y={relatedTarget:e.relatedTarget},x=this.state.actions.selectOption&&(m||!i.dropdown.closeOnSelect),S=this.state.actions.addNew&&m;if(u){if(e.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),i.onChangeAfterBlur&&this.triggerChangeEvent()}if(!(x||S||a))if(this.state.hasFocus=!(!l&&!r)&&+new Date,this.toggleFocusClass(this.state.hasFocus),i.mode!="mix"){if(l){if(!i.focusable)return;var C=i.dropdown.enabled===0&&!this.state.dropdown.visible,T=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector);return this.trigger("focus",y),void(C&&!s&&(this.dropdown.show(this.value.length?"":void 0),i.mode==="select"&&this.setRangeAtStartEnd(!1,T)))}if(u){if(this.trigger("blur",y),this.loading(!1),i.mode=="select"){if(this.value.length){var A=this.getTagElms()[0];h=this.trim(A.textContent)}d===h&&(h="")}h&&!this.state.actions.selectOption&&i.addTagOnBlur&&i.addTagOn.includes("blur")&&this.addTags(h,!0)}r||(this.DOM.input.removeAttribute("style"),this.dropdown.hide())}else l?this.trigger("focus",y):u&&(this.trigger("blur",y),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart:function(e){this.state.composing=!0},onCompositionEnd:function(e){this.state.composing=!1},onWindowKeyDown:function(e){var t,n=this.settings,i=document.activeElement,r=Kg.call(this,i)&&this.DOM.scope.contains(i),s=i===this.DOM.input,a=r&&i.hasAttribute("readonly"),l=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector),u=this.state.dropdown.visible;if((e.key==="Tab"&&u||this.state.hasFocus||r&&!a)&&!s){t=i.nextElementSibling;var h=e.target.classList.contains(n.classNames.tagX);switch(e.key){case"Backspace":n.readonly||this.state.editing||(this.removeTags(i),(t||this.DOM.input).focus());break;case"Enter":if(h)return void this.removeTags(e.target.parentNode);n.a11y.focusableTags&&Tr.call(this,i)&&setTimeout(this.editTag.bind(this),0,i);break;case"ArrowDown":this.state.dropdown.visible||n.mode=="mix"||this.dropdown.show();break;case"Tab":l==null||l.focus()}}},onKeydown:function(e){var t=this,n=this.settings;if(!this.state.composing&&n.userInput){n.mode=="select"&&n.enforceWhitelist&&this.value.length&&e.key!="Tab"&&e.preventDefault();var i=this.trim(e.target.textContent);this.trigger("keydown",{event:e}),n.hooks.beforeKeyDown(e,{tagify:this}).then(function(r){if(n.mode=="mix"){switch(e.key){case"Left":case"ArrowLeft":t.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(t.state.editing)return;var s=document.getSelection(),a=e.key=="Delete"&&s.anchorOffset==(s.anchorNode.length||0),l=s.anchorNode.previousSibling,u=s.anchorNode.nodeType==1||!s.anchorOffset&&l&&l.nodeType==1&&s.anchorNode.previousSibling;(function(A){var M=document.createElement("div");A.replace(/\&#?[0-9a-z]+;/gi,function(B){return M.innerHTML=B,M.innerText})})(t.DOM.input.innerHTML);var h,d,m,y=t.getTagElms(),x=s.anchorNode.length===1&&s.anchorNode.nodeValue=="​";if(n.backspace=="edit"&&u)return h=s.anchorNode.nodeType==1?null:s.anchorNode.previousElementSibling,setTimeout(t.editTag.bind(t),0,h),void e.preventDefault();if(Xg()&&Zg(u,Element))return m=Vg(u),u.hasAttribute("readonly")||u.remove(),t.DOM.input.focus(),void setTimeout(function(){Wi(m),t.DOM.input.click()});if(s.anchorNode.nodeName=="BR")return;if((a||u)&&s.anchorNode.nodeType==1?d=s.anchorOffset==0?a?y[0]:null:y[Math.min(y.length,s.anchorOffset)-1]:a?d=s.anchorNode.nextElementSibling:Zg(u,Element)&&(d=u),s.anchorNode.nodeType==3&&!s.anchorNode.nodeValue&&s.anchorNode.previousElementSibling&&e.preventDefault(),(u||a)&&!n.backspace||s.type!="Range"&&!s.anchorOffset&&s.anchorNode==t.DOM.input&&e.key!="Delete")return void e.preventDefault();if(s.type!="Range"&&d&&d.hasAttribute("readonly"))return void Wi(Vg(d));e.key=="Delete"&&x&&Zt(s.anchorNode.nextSibling)&&t.removeTags(s.anchorNode.nextSibling)}return!0}var S=n.dropdown.position=="manual";switch(e.key){case"Backspace":n.mode=="select"&&n.enforceWhitelist&&t.value.length?t.removeTags():t.state.dropdown.visible&&n.dropdown.position!="manual"||e.target.textContent!=""&&i.charCodeAt(0)!=8203||(n.backspace===!0?t.removeTags():n.backspace=="edit"&&setTimeout(t.editTag.bind(t),0));break;case"Esc":case"Escape":if(t.state.dropdown.visible)return;e.target.blur();break;case"Down":case"ArrowDown":t.state.dropdown.visible||t.dropdown.show();break;case"ArrowRight":var C=t.state.inputSuggestion||t.state.ddItemData;if(C&&n.autoComplete.rightKey)return void t.addTags([C],!0);break;case"Tab":return!0;case"Enter":if(t.state.dropdown.visible&&!S)return;e.preventDefault();var T=t.state.autoCompleteData||i;setTimeout(function(){t.state.dropdown.visible&&!S||t.state.actions.selectOption||!n.addTagOn.includes(e.key.toLowerCase())||(t.addTags([T],!0),t.state.autoCompleteData=null)})}}).catch(function(r){return r})}},onInput:function(e){this.postUpdate();var t=this.settings;if(t.mode=="mix")return this.events.callbacks.onMixTagsInput.call(this,e);var n=this.input.normalize.call(this,void 0,{trim:!1}),i=n.length>=t.dropdown.enabled,r={value:n,inputElm:this.DOM.input},s=this.validateTag({value:n});t.mode=="select"&&this.toggleScopeValidation(s),r.isValid=s,this.state.inputText!=n&&(this.input.set.call(this,n,!1),n.search(t.delimiters)!=-1?this.addTags(n)&&this.input.set.call(this):t.dropdown.enabled>=0&&this.dropdown[i?"show":"hide"](n),this.trigger("input",r))},onMixTagsInput:function(e){var t,n,i,r,s,a,l,u,h=this,d=this.settings,m=this.value.length,y=this.getTagElms(),x=document.createDocumentFragment(),S=window.getSelection().getRangeAt(0),C=[].map.call(y,function(T){return Zt(T).value});if(e.inputType=="deleteContentBackward"&&Xg()&&this.events.callbacks.onKeydown.call(this,{target:e.target,key:"Backspace"}),Ab(this.getTagElms()),this.value.slice().forEach(function(T){T.readonly&&!C.includes(T.value)&&x.appendChild(h.createTagElem(T))}),x.childNodes.length&&(S.insertNode(x),this.setRangeAtStartEnd(!1,x.lastChild)),y.length!=m)return this.value=[].map.call(this.getTagElms(),function(T){return Zt(T)}),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(a=window.getSelection()).rangeCount>0&&a.anchorNode.nodeType==3){if((S=a.getRangeAt(0).cloneRange()).collapse(!0),S.setStart(a.focusNode,0),i=(t=S.toString().slice(0,S.endOffset)).split(d.pattern).length-1,(n=t.match(d.pattern))&&(r=t.slice(t.lastIndexOf(n[n.length-1]))),r){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:r.match(d.pattern)[0],value:r.replace(d.pattern,"")},this.state.tag.baseOffset=a.baseOffset-this.state.tag.value.length,u=this.state.tag.value.match(d.delimiters))return this.state.tag.value=this.state.tag.value.replace(d.delimiters,""),this.state.tag.delimiters=u[0],this.addTags(this.state.tag.value,d.dropdown.clearOnSelect),void this.dropdown.hide();s=this.state.tag.value.length>=d.dropdown.enabled;try{l=(l=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&l.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch{}(l||i<this.state.mixMode.matchedPatternCount)&&(s=!1)}else this.state.flaggedTags={};this.state.mixMode.matchedPatternCount=i}setTimeout(function(){h.update({withoutChangeEvent:!0}),h.trigger("input",Oe({},h.state.tag,{textContent:h.DOM.input.textContent})),h.state.tag&&h.dropdown[s?"show":"hide"](h.state.tag.value)},10)},onInputIE:function(e){var t=this;setTimeout(function(){t.events.callbacks.onInput.call(t,e)})},observeOriginalInputValue:function(){this.DOM.originalInput.parentNode||this.destroy(),this.DOM.originalInput.value!=this.DOM.originalInput.tagifyValue&&this.loadOriginalValues()},onClickAnywhere:function(e){if(e.target!=this.DOM.scope&&!this.DOM.scope.contains(e.target)){this.toggleFocusClass(!1),this.state.hasFocus=!1;var t=e.target.closest(this.settings.classNames.dropdownSelector);(t==null?void 0:t.__tagify)!=this&&this.dropdown.hide()}},onClickScope:function(e){var t=this.settings,n=e.target.closest("."+t.classNames.tag);e.target,this.DOM.scope;var i=+new Date-this.state.hasFocus;if(!e.target.classList.contains(t.classNames.tagX))return n&&!this.state.editing?(this.trigger("click",{tag:n,index:this.getNodeIndex(n),data:Zt(n),event:e}),void(t.editTags!==1&&t.editTags.clicks!==1&&t.mode!="select"||this.events.callbacks.onDoubleClickScope.call(this,e))):void(e.target==this.DOM.input&&(t.mode=="mix"&&this.fixFirefoxLastTagNoCaret(),i>500||!t.focusable)?this.state.dropdown.visible?this.dropdown.hide():t.dropdown.enabled===0&&t.mode!="mix"&&this.dropdown.show(this.value.length?"":void 0):t.mode!="select"||t.dropdown.enabled!==0||this.state.dropdown.visible||(this.events.callbacks.onDoubleClickScope.call(this,pk(function(r){for(var s=1;s<arguments.length;s++){var a=arguments[s]!=null?arguments[s]:{},l=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(l=l.concat(Object.getOwnPropertySymbols(a).filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable}))),l.forEach(function(u){mr(r,u,a[u])})}return r}({},e),{target:this.getTagElms()[0]})),!t.userInput&&this.dropdown.show()));this.removeTags(e.target.parentNode)},onPaste:function(e){var t=this;e.preventDefault();var n,i,r,s=this.settings;if(!s.userInput)return!1;s.readonly||(i=e.clipboardData||window.clipboardData,r=i.getData("Text"),s.hooks.beforePaste(e,{tagify:this,pastedText:r,clipboardData:i}).then(function(a){a===void 0&&(a=r),a&&(t.injectAtCaret(a,window.getSelection().getRangeAt(0)),t.settings.mode=="mix"?t.events.callbacks.onMixTagsInput.call(t,e):t.settings.pasteAsTags?n=t.addTags(t.state.inputText+a,!0):(t.state.inputText=a,t.dropdown.show(a))),t.trigger("paste",{event:e,pastedText:r,clipboardData:i,tagsElems:n})}).catch(function(a){return a}))},onDrop:function(e){e.preventDefault()},onEditTagInput:function(e,t){var n,i=e.closest("."+this.settings.classNames.tag),r=this.getNodeIndex(i),s=Zt(i),a=this.input.normalize.call(this,e),l=(mr(n={},this.settings.tagTextProp,a),mr(n,"__tagId",s.__tagId),n),u=this.validateTag(l);this.editTagChangeDetected(Oe(s,l))||e.originalIsValid!==!0||(u=!0),i.classList.toggle(this.settings.classNames.tagInvalid,u!==!0),s.__isValid=u,i.title=u===!0?s.title||s.value:u,a.length>=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=a),this.dropdown.show(a)),this.trigger("edit:input",{tag:i,index:r,data:Oe({},this.value[r],{newValue:a}),event:t})},onEditTagPaste:function(e,t){var n=(t.clipboardData||window.clipboardData).getData("Text");t.preventDefault();var i=kb(n);this.setRangeAtStartEnd(!1,i)},onEditTagClick:function(e,t){this.events.callbacks.onClickScope.call(this,t)},onEditTagFocus:function(e){this.state.editing={scope:e,input:e.querySelector("[contenteditable]")}},onEditTagBlur:function(e,t){var n=Tr.call(this,t.relatedTarget);if(this.settings.mode=="select"&&n&&t.relatedTarget.contains(t.target))this.dropdown.hide();else if(this.state.editing&&(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(document.activeElement)||this.trigger("blur",{}),this.DOM.scope.contains(e))){var i,r,s,a=this.settings,l=e.closest("."+a.classNames.tag),u=Zt(l),h=this.input.normalize.call(this,e),d=(mr(i={},a.tagTextProp,h),mr(i,"__tagId",u.__tagId),i),m=u.__originalData,y=this.editTagChangeDetected(Oe(u,d)),x=this.validateTag(d);if(h)if(y){var S;if(r=this.hasMaxTags(),s=Oe({},m,(mr(S={},a.tagTextProp,this.trim(h)),mr(S,"__isValid",x),S)),a.transformTag.call(this,s,m),(x=(!r||m.__isValid===!0)&&this.validateTag(s))!==!0){if(this.trigger("invalid",{data:s,tag:l,message:x}),a.editTags.keepInvalid)return;a.keepInvalidTags?s.__isValid=x:s=m}else a.keepInvalidTags&&(delete s.title,delete s["aria-invalid"],delete s.class);this.onEditTagDone(l,s)}else this.onEditTagDone(l,m);else this.onEditTagDone(l)}},onEditTagkeydown:function(e,t){if(!this.state.composing)switch(this.trigger("edit:keydown",{event:e}),e.key){case"Esc":case"Escape":this.state.editing=!1,t.__tagifyTagData.__originalData.value?t.parentNode.replaceChild(t.__tagifyTagData.__originalHTML,t):t.remove();break;case"Enter":case"Tab":e.preventDefault(),setTimeout(function(){return e.target.blur()},0)}},onDoubleClickScope:function(e){var t=e.target.closest("."+this.settings.classNames.tag);if(t){var n,i,r=Zt(t),s=this.settings;(r==null?void 0:r.editable)!==!1&&(n=t.classList.contains(this.settings.classNames.tagEditing),i=t.hasAttribute("readonly"),s.readonly||n||i||!this.settings.editTags||!s.userInput||(this.events.callbacks.onEditTagFocus.call(this,t),this.editTag(t)),this.toggleFocusClass(!0),s.mode!="select"&&this.trigger("dblclick",{tag:t,index:this.getNodeIndex(t),data:Zt(t)}))}},onInputDOMChange:function(e){var t=this;e.forEach(function(i){i.addedNodes.forEach(function(r){if(r.outerHTML=="<div><br></div>")r.replaceWith(document.createElement("br"));else if(r.nodeType==1&&r.querySelector(t.settings.classNames.tagSelector)){var s,a=document.createTextNode("");r.childNodes[0].nodeType==3&&r.previousSibling.nodeName!="BR"&&(a=document.createTextNode(`
`)),(s=r).replaceWith.apply(s,Hh([a].concat(Hh(Hh(r.childNodes).slice(0,-1))))),Wi(a)}else if(Tr.call(t,r)){var l;if(((l=r.previousSibling)===null||l===void 0?void 0:l.nodeType)!=3||r.previousSibling.textContent||r.previousSibling.remove(),r.previousSibling&&r.previousSibling.nodeName=="BR"){r.previousSibling.replaceWith(`
​`);for(var u=r.nextSibling,h="";u;)h+=u.textContent,u=u.nextSibling;h.trim()&&Wi(r.previousSibling)}else r.previousSibling&&!Zt(r.previousSibling)||r.before("​")}}),i.removedNodes.forEach(function(r){r&&r.nodeName=="BR"&&Tr.call(t,n)&&(t.removeTags(n),t.fixFirefoxLastTagNoCaret())})});var n=this.DOM.input.lastChild;n&&n.nodeValue==""&&n.remove(),n&&n.nodeName=="BR"||this.DOM.input.appendChild(document.createElement("br"))}}};function zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function vf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yi(e,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Qg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},i=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),i.forEach(function(r){vf(e,r,n[r])})}return e}function Rl(e){return function(t){if(Array.isArray(t))return zh(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(t){if(typeof t=="string")return zh(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(i);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return zh(t,n)}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ql(e,t){if(!e){qi.warn("input element not found",e);var n=new Proxy(this,{get:function(){return function(){return n}}});return n}if(e.__tagify)return qi.warn("input element is already Tagified - Same instance is returned.",e),e.__tagify;var i;Oe(this,function(r){var s=document.createTextNode(""),a={};function l(u,h,d){d&&h.split(/\s+/g).forEach(function(m){return s[u+"EventListener"].call(s,m,d)})}return{removeAllCustomListeners:function(){Object.entries(a).forEach(function(u){var h=dk(u,2),d=h[0];h[1].forEach(function(m){return l("remove",d,m)})}),a={}},off:function(u,h){return u&&(h?l("remove",u,h):u.split(/\s+/g).forEach(function(d){var m;(m=a[d])===null||m===void 0||m.forEach(function(y){return l("remove",d,y)}),delete a[d]})),this},on:function(u,h){return h&&typeof h=="function"&&(u.split(/\s+/g).forEach(function(d){Array.isArray(a[d])?a[d].push(h):a[d]=[h]}),l("add",u,h)),this},trigger:function(u,h,d){var m;if(d=d||{cloneData:!0},u)if(r.settings.isJQueryPlugin)u=="remove"&&(u="removeTag"),jQuery(r.DOM.originalInput).triggerHandler(u,[h]);else{try{var y=typeof h=="object"?h:{value:h};if((y=d.cloneData?Oe({},y):y).tagify=this,h.event&&(y.event=this.cloneEvent(h.event)),Jg(h,Object))for(var x in h)Jg(h[x],HTMLElement)&&(y[x]=h[x]);m=new CustomEvent(u,{detail:y})}catch(S){qi.warn(S)}s.dispatchEvent(m)}}}}(this)),this.isFirefox=/firefox|fxios/i.test(navigator.userAgent)&&!/seamonkey/i.test(navigator.userAgent),this.isIE=window.document.documentMode,t=t||{},this.getPersistedData=(i=t.id,function(r){var s;if(i){var a,l="/"+r;if(((s=localStorage)===null||s===void 0?void 0:s.getItem(mo+i+"/v"))===1)try{a=JSON.parse(localStorage[mo+i+l])}catch{}return a}}),this.setPersistedData=function(r){var s;return r?((s=localStorage)===null||s===void 0||s.setItem(mo+r+"/v",1),function(a,l){var u,h="/"+l,d=JSON.stringify(a);a&&l&&((u=localStorage)===null||u===void 0||u.setItem(mo+r+h,d),dispatchEvent(new Event("storage")))}):function(){}}(t.id),this.clearPersistedData=function(r){return function(s){var a=mo+"/"+r+"/";if(s)localStorage.removeItem(a+s);else for(var l in localStorage)l.includes(a)&&localStorage.removeItem(l)}}(t.id),this.applySettings(e,t),this.state={inputText:"",editing:!1,composing:!1,actions:{},mixMode:{},dropdown:{},flaggedTags:{}},this.value=[],this.listeners={},this.DOM={},this.build(e),ck.call(this),this.getCSSVars(),this.loadOriginalValues(),this.events.customBinding.call(this),this.events.binding.call(this),e.autofocus&&this.DOM.input.focus(),e.__tagify=this}Ql.prototype={_dropdown:uk,placeCaretAfterNode:Wi,getSetTagData:Zt,helpers:{sameStr:To,removeCollectionProp:Ug,omit:mf,isObject:Wn,parseHTML:Ih,escapeHTML:wr,extend:Oe,concatWithoutDups:qg,getUID:Yg,isNodeTag:Tr},customEventsList:["change","add","remove","invalid","input","paste","click","keydown","focus","blur","edit:input","edit:beforeUpdate","edit:updated","edit:start","edit:keydown","dropdown:show","dropdown:hide","dropdown:select","dropdown:updated","dropdown:noMatch","dropdown:scroll"],dataProps:["__isValid","__removed","__originalData","__originalHTML","__tagId"],trim:function(e){return this.settings.trim&&e&&typeof e=="string"?e.trim():e},parseHTML:Ih,templates:fk,parseTemplate:function(e,t){return Ih((e=this.settings.templates[e]||e).apply(this,t))},set whitelist(e){var t=e&&Array.isArray(e);this.settings.whitelist=t?e:[],this.setPersistedData(t?e:[],"whitelist")},get whitelist(){return this.settings.whitelist},set userInput(e){this.settings.userInput=!!e,this.setContentEditable(!!e)},get userInput(){return this.settings.userInput},generateClassSelectors:function(e){var t=function(i){var r=i;Object.defineProperty(e,r+"Selector",{get:function(){return"."+this[r].split(" ")[0]}})};for(var n in e)t(n)},applySettings:function(e,t){var n,i;Nh.templates=this.templates;var r=Oe({},Nh,t.mode=="mix"?{dropdown:{position:"text"}}:{}),s=this.settings=Oe({},r,t);if(s.disabled=e.hasAttribute("disabled"),s.readonly=s.readonly||e.hasAttribute("readonly"),s.placeholder=wr(e.getAttribute("placeholder")||s.placeholder||""),s.required=e.hasAttribute("required"),this.generateClassSelectors(s.classNames),this.isIE&&(s.autoComplete=!1),["whitelist","blacklist"].forEach(function(l){var u=e.getAttribute("data-"+l);u&&yi(u=u.split(s.delimiters),Array)&&(s[l]=u)}),"autoComplete"in t&&!Wn(t.autoComplete)&&(s.autoComplete=Nh.autoComplete,s.autoComplete.enabled=t.autoComplete),s.mode=="mix"&&(s.pattern=s.pattern||/@/,s.autoComplete.rightKey=!0,s.delimiters=t.delimiters||null,s.tagTextProp&&!s.dropdown.searchKeys.includes(s.tagTextProp)&&s.dropdown.searchKeys.push(s.tagTextProp)),e.pattern)try{s.pattern=new RegExp(e.pattern)}catch{}if(s.delimiters){s._delimiters=s.delimiters;try{s.delimiters=new RegExp(this.settings.delimiters,"g")}catch{}}(s.disabled||s.readonly)&&(s.userInput=!1),this.TEXTS=Qg({},hk,s.texts||{}),s.mode=="select"&&(s.dropdown.includeSelectedTags=!0),(s.mode!="select"||!((n=t.dropdown)===null||n===void 0)&&n.enabled)&&s.userInput||(s.dropdown.enabled=0),s.disabled&&(s.dropdown.enabled=!1),s.dropdown.appendTarget=((i=t.dropdown)===null||i===void 0?void 0:i.appendTarget)||document.body,s.dropdown.includeSelectedTags===void 0&&(s.dropdown.includeSelectedTags=s.duplicates);var a=this.getPersistedData("whitelist");Array.isArray(a)&&(this.whitelist=Array.isArray(s.whitelist)?qg(s.whitelist,a):a)},getAttributes:function(e){var t,n=this.getCustomAttributes(e),i="";for(t in n)i+=" "+t+(e[t]!==void 0?'="'.concat(n[t],'"'):"");return i},getCustomAttributes:function(e){if(!Wn(e))return"";var t,n={};for(t in e)t.slice(0,2)!="__"&&t!="class"&&e.hasOwnProperty(t)&&e[t]!==void 0&&(n[t]=wr(e[t]));return n},setStateSelection:function(){var e=window.getSelection(),t={anchorOffset:e.anchorOffset,anchorNode:e.anchorNode,range:e.getRangeAt&&e.rangeCount&&e.getRangeAt(0)};return this.state.selection=t,t},getCSSVars:function(){var e,t,n,i=getComputedStyle(this.DOM.scope,null);this.CSSVars={tagHideTransition:(e=function(r){if(!r)return{};var s=(r=r.trim().split(" ")[0]).split(/\d+/g).filter(function(a){return a}).pop().trim();return{value:+r.split(s).filter(function(a){return a})[0].trim(),unit:s}}((n="tag-hide-transition",i.getPropertyValue("--"+n))),t=e.value,e.unit=="s"?1e3*t:t)}},build:function(e){var t=this.DOM,n=e.closest("label");this.settings.mixMode.integrated?(t.originalInput=null,t.scope=e,t.input=e):(t.originalInput=e,t.originalInput_tabIndex=e.tabIndex,t.scope=this.parseTemplate("wrapper",[e,this.settings]),t.input=t.scope.querySelector(this.settings.classNames.inputSelector),e.parentNode.insertBefore(t.scope,e),e.tabIndex=-1),n&&n.setAttribute("for","")},destroy:function(){var e;this.events.unbindGlobal.call(this),(e=this.DOM.scope.parentNode)===null||e===void 0||e.removeChild(this.DOM.scope),this.DOM.originalInput.tabIndex=this.DOM.originalInput_tabIndex,delete this.DOM.originalInput.__tagify,this.dropdown.hide(!0),this.removeAllCustomListeners(),clearTimeout(this.dropdownHide__bindEventsTimeout),clearInterval(this.listeners.main.originalInputValueObserverInterval)},loadOriginalValues:function(e){var t,n=this.settings;if(this.state.blockChangeEvent=!0,e===void 0){var i=this.getPersistedData("value");e=i&&!this.DOM.originalInput.value?i:n.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value}if(this.removeAllTags(),e)if(n.mode=="mix")this.parseMixTags(e),(t=this.DOM.input.lastChild)&&t.tagName=="BR"||this.DOM.input.insertAdjacentHTML("beforeend","<br>");else{try{yi(JSON.parse(e),Array)&&(e=JSON.parse(e))}catch{}this.addTags(e,!0).forEach(function(r){return r&&r.classList.add(n.classNames.tagNoAnimation)})}else this.postUpdate();this.state.lastOriginalValueReported=n.mixMode.integrated?"":this.DOM.originalInput.value},cloneEvent:function(e){var t={};for(var n in e)n!="path"&&(t[n]=e[n]);return t},loading:function(e){return this.state.isLoading=e,this.DOM.scope.classList[e?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading:function(e,t){return e&&e.classList[t?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass:function(e,t){typeof e=="string"&&this.DOM.scope.classList.toggle(e,t)},toggleScopeValidation:function(e){var t=e===!0||e===void 0;!this.settings.required&&e&&e===this.TEXTS.empty&&(t=!0),this.toggleClass(this.settings.classNames.tagInvalid,!t),this.DOM.scope.title=t?"":e},toggleFocusClass:function(e){this.toggleClass(this.settings.classNames.focus,!!e)},setPlaceholder:function(e){var t=this;["data","aria"].forEach(function(n){return t.DOM.input.setAttribute("".concat(n,"-placeholder"),e)})},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var e=this.DOM.originalInput,t=this.state.lastOriginalValueReported!==e.value,n=new CustomEvent("change",{bubbles:!0});t&&(this.state.lastOriginalValueReported=e.value,n.simulated=!0,e._valueTracker&&e._valueTracker.setValue(Math.random()),e.dispatchEvent(n),this.trigger("change",this.state.lastOriginalValueReported),e.value=this.state.lastOriginalValueReported)}},events:gk,fixFirefoxLastTagNoCaret:function(){},setRangeAtStartEnd:function(e,t){if(t){e=typeof e=="number"?e:!!e,t=t.lastChild||t;var n=document.getSelection();if(yi(n.focusNode,Element)&&!this.DOM.input.contains(n.focusNode))return!0;try{n.rangeCount>=1&&["Start","End"].forEach(function(i){return n.getRangeAt(0)["set"+i](t,e||t.length)})}catch(i){console.warn(i)}}},insertAfterTag:function(e,t){if(t=t||this.settings.mixMode.insertAfterTag,e&&e.parentNode&&t)return t=typeof t=="string"?document.createTextNode(t):t,e.parentNode.insertBefore(t,e.nextSibling),t},editTagChangeDetected:function(e){var t=e.__originalData;for(var n in t)if(!this.dataProps.includes(n)&&e[n]!=t[n])return!0;return!1},getTagTextNode:function(e){return e.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode:function(e,t){this.getTagTextNode(e).innerHTML=wr(t)},editTag:function(e,t){var n=this;e=e||this.getLastTag(),t=t||{};var i=this.settings,r=this.getTagTextNode(e),s=this.getNodeIndex(e),a=Zt(e),l=this.events.callbacks,u=!0,h=i.mode=="select";if(!h&&this.dropdown.hide(),r){if(!yi(a,Object)||!("editable"in a)||a.editable)return a=Zt(e,{__originalData:Oe({},a),__originalHTML:e.cloneNode(!0)}),Zt(a.__originalHTML,a.__originalData),r.setAttribute("contenteditable",!0),e.classList.add(i.classNames.tagEditing),this.events.callbacks.onEditTagFocus.call(this,e),r.addEventListener("click",l.onEditTagClick.bind(this,e)),r.addEventListener("blur",l.onEditTagBlur.bind(this,this.getTagTextNode(e))),r.addEventListener("input",l.onEditTagInput.bind(this,r)),r.addEventListener("paste",l.onEditTagPaste.bind(this,r)),r.addEventListener("keydown",function(d){return l.onEditTagkeydown.call(n,d,e)}),r.addEventListener("compositionstart",l.onCompositionStart.bind(this)),r.addEventListener("compositionend",l.onCompositionEnd.bind(this)),t.skipValidation||(u=this.editTagToggleValidity(e)),r.originalIsValid=u,this.trigger("edit:start",{tag:e,index:s,data:a,isValid:u}),r.focus(),!h&&this.setRangeAtStartEnd(!1,r),i.dropdown.enabled===0&&!h&&this.dropdown.show(),this.state.hasFocus=!0,this}else qi.warn("Cannot find element in Tag template: .",i.classNames.tagTextSelector)},editTagToggleValidity:function(e,t){var n;if(t=t||Zt(e))return(n=!("__isValid"in t)||t.__isValid===!0)||this.removeTagsFromValue(e),this.update(),e.classList.toggle(this.settings.classNames.tagNotAllowed,!n),t.__isValid=n,t.__isValid;qi.warn("tag has no data: ",e,t)},onEditTagDone:function(e,t){e=e||this.state.editing.scope,t=t||{};var n,i,r=this.settings,s={tag:e,index:this.getNodeIndex(e),previousData:Zt(e),data:t};this.trigger("edit:beforeUpdate",s,{cloneData:!1}),this.state.editing=!1,delete t.__originalData,delete t.__originalHTML,e&&e.parentNode&&(((i=t[r.tagTextProp])!==void 0?!((n=(i+="").trim)===null||n===void 0)&&n.call(i):!(r.tagTextProp in t)&&t.value)?(e=this.replaceTag(e,t),this.editTagToggleValidity(e,t),r.a11y.focusableTags?e.focus():r.mode!="select"&&Wi(e)):this.removeTags(e)),this.trigger("edit:updated",s),r.dropdown.closeOnSelect&&this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag:function(e,t){t&&t.value!==""&&t.value!==void 0||(t=e.__tagifyTagData),t.__isValid&&t.__isValid!=1&&Oe(t,this.getInvalidTagAttrs(t,t.__isValid));var n=this.createTagElem(t);return e.parentNode.replaceChild(n,e),this.updateValueByDOMTags(),n},updateValueByDOMTags:function(){var e=this;this.value.length=0;var t=this.settings.classNames,n=[t.tagNotAllowed.split(" ")[0],t.tagHide];[].forEach.call(this.getTagElms(),function(i){Rl(i.classList).some(function(r){return n.includes(r)})||e.value.push(Zt(i))}),this.update(),this.dropdown.refilter()},injectAtCaret:function(e,t){var n;if(t=t||((n=this.state.selection)===null||n===void 0?void 0:n.range),typeof e=="string"&&(e=document.createTextNode(e)),!t&&e)return this.appendMixTags(e),this;var i=kb(e,t);return this.setRangeAtStartEnd(!1,i),this.updateValueByDOMTags(),this.update(),this},input:{set:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.settings,i=n.dropdown.closeOnSelect;this.state.inputText=e,t&&(this.DOM.input.innerHTML=wr(""+e),e&&this.toggleClass(n.classNames.empty,!this.DOM.input.innerHTML)),!e&&i&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw:function(){return this.DOM.input.textContent},validate:function(){var e=!this.state.inputText||this.validateTag({value:this.state.inputText})===!0;return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!e),e},normalize:function(e,t){var n=e||this.DOM.input,i=[];n.childNodes.forEach(function(r){return r.nodeType==3&&i.push(r.nodeValue)}),i=i.join(`
`);try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch{}return i=i.replace(/\s/g," "),t!=null&&t.trim?this.trim(i):i},autocomplete:{suggest:function(e){if(this.settings.autoComplete.enabled){typeof(e=e||{value:""})!="object"&&(e={value:e});var t=this.dropdown.getMappedValue(e);if(typeof t!="number"){var n=this.state.inputText.toLowerCase(),i=t.substr(0,this.state.inputText.length).toLowerCase(),r=t.substring(this.state.inputText.length);t&&this.state.inputText&&i==n?(this.DOM.input.setAttribute("data-suggest",r),this.state.inputSuggestion=e):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}}},set:function(e){var t=this.DOM.input.getAttribute("data-suggest"),n=e||(t?this.state.inputText+t:null);return!!n&&(this.settings.mode=="mix"?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+n)):(this.input.set.call(this,n),this.setRangeAtStartEnd(!1,this.DOM.input)),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx:function(e){return this.value.findIndex(function(t){return t.__tagId==(e||{}).__tagId})},getNodeIndex:function(e){var t=0;if(e)for(;e=e.previousElementSibling;)t++;return t},getTagElms:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i="."+Rl(this.settings.classNames.tag.split(" ")).concat(Rl(t)).join(".");return[].slice.call(this.DOM.scope.querySelectorAll(i))},getLastTag:function(){var e=this.settings.classNames,t=this.DOM.scope.querySelectorAll("".concat(e.tagSelector,":not(.").concat(e.tagHide,"):not([readonly])"));return t[t.length-1]},isTagDuplicate:function(e,t,n){var i=0,r=!0,s=!1,a=void 0;try{for(var l,u=this.value[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var h=l.value;To(this.trim(""+e),h.value,t)&&n!=h.__tagId&&i++}}catch(d){s=!0,a=d}finally{try{r||u.return==null||u.return()}finally{if(s)throw a}}return i},getTagIndexByValue:function(e){var t=this,n=[],i=this.settings.dropdown.caseSensitive;return this.getTagElms().forEach(function(r,s){r.__tagifyTagData&&To(t.trim(r.__tagifyTagData.value),e,i)&&n.push(s)}),n},getTagElmByValue:function(e){var t=this.getTagIndexByValue(e)[0];return this.getTagElms()[t]},flashTag:function(e){var t=this;e&&(e.classList.add(this.settings.classNames.tagFlash),setTimeout(function(){e.classList.remove(t.settings.classNames.tagFlash)},100))},isTagBlacklisted:function(e){return e=this.trim(e.toLowerCase()),this.settings.blacklist.filter(function(t){return(""+t).toLowerCase()==e}).length},isTagWhitelisted:function(e){return!!this.getWhitelistItem(e)},getWhitelistItem:function(e,t,n){t=t||"value";var i,r=this.settings;return(n=n||r.whitelist).some(function(s){var a=typeof s=="object"?s[t]||s.value:s;if(To(a,e,r.dropdown.caseSensitive,r.trim))return i=typeof s=="object"?s:{value:s},!0}),i||t!="value"||r.tagTextProp=="value"||(i=this.getWhitelistItem(e,r.tagTextProp,n)),i},validateTag:function(e){var t=this.settings,n="value"in e?"value":t.tagTextProp,i=this.trim(e[n]+"");return(e[n]+"").trim()?t.mode!="mix"&&t.pattern&&yi(t.pattern,RegExp)&&!t.pattern.test(i)?this.TEXTS.pattern:!t.duplicates&&this.isTagDuplicate(i,t.dropdown.caseSensitive,e.__tagId)?this.TEXTS.duplicate:this.isTagBlacklisted(i)||t.enforceWhitelist&&!this.isTagWhitelisted(i)?this.TEXTS.notAllowed:!t.validate||t.validate(e):this.TEXTS.empty},getInvalidTagAttrs:function(e,t){return{"aria-invalid":!0,class:"".concat(e.class||""," ").concat(this.settings.classNames.tagNotAllowed).trim(),title:t}},hasMaxTags:function(){return this.value.length>=this.settings.maxTags&&this.TEXTS.exceed},setReadonly:function(e,t){var n=this.settings;this.DOM.scope.contains(document.activeElement)&&document.activeElement.blur(),n[t||"readonly"]=e,this.DOM.scope[(e?"set":"remove")+"Attribute"](t||"readonly",!0),this.settings.userInput=!0,this.setContentEditable(!e)},setContentEditable:function(e){this.DOM.scope.querySelectorAll("[data-can-editable]").forEach(function(t){t.contentEditable=e,t.tabIndex=e?0:-1})},setDisabled:function(e){this.setReadonly(e,"disabled")},normalizeTags:function(e){var t=this,n=this.settings,i=n.whitelist,r=n.delimiters,s=n.mode,a=n.tagTextProp,l=[],u=!!i&&yi(i[0],Object),h=Array.isArray(e),d=h&&e[0].value,m=function(y){return(y+"").split(r).reduce(function(x,S){var C,T=t.trim(S);return T&&x.push((vf(C={},a,T),vf(C,"value",T),C)),x},[])};if(typeof e=="number"&&(e=e.toString()),typeof e=="string"){if(!e.trim())return[];e=m(e)}else h&&(e=e.reduce(function(y,x){if(Wn(x)){var S=Oe({},x);a in S||(a="value"),S[a]=t.trim(S[a]),(S[a]||S[a]===0)&&y.push(S)}else if(x!=null&&x!==""&&x!==void 0){var C;(C=y).push.apply(C,Rl(m(x)))}return y},[]));return u&&!d&&(e.forEach(function(y){var x=l.map(function(T){return T.value}),S=t.dropdown.filterListItems.call(t,y[a],{exact:!0});t.settings.duplicates||(S=S.filter(function(T){return!x.includes(T.value)}));var C=S.length>1?t.getWhitelistItem(y[a],a,S):S[0];C&&yi(C,Object)?l.push(C):s!="mix"&&(y.value==null&&(y.value=y[a]),l.push(y))}),l.length&&(e=l)),e},parseMixTags:function(e){var t=this,n=this.settings,i=n.mixTagsInterpolator,r=n.duplicates,s=n.transformTag,a=n.enforceWhitelist,l=n.maxTags,u=n.tagTextProp,h=[];e=e.split(i[0]).map(function(m,y){var x,S,C,T=m.split(i[1]),A=T[0],M=h.length==l;try{if(A==+A)throw Error;S=JSON.parse(A)}catch{S=t.normalizeTags(A)[0]||{value:A}}if(s.call(t,S),M||!(T.length>1)||a&&!t.isTagWhitelisted(S.value)||!r&&t.isTagDuplicate(S.value)){if(m)return y?i[0]+m:m}else S[x=S[u]?u:"value"]=t.trim(S[x]),C=t.createTagElem(S),h.push(S),C.classList.add(t.settings.classNames.tagNoAnimation),T[0]=C.outerHTML,t.value.push(S);return T.join("")}).join(""),this.DOM.input.innerHTML=e,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize();var d=this.getTagElms();return d.forEach(function(m,y){return Zt(m,h[y])}),this.update({withoutChangeEvent:!0}),Ab(d,this.state.hasFocus),e},replaceTextWithNode:function(e,t){if(this.state.tag||t){t=t||this.state.tag.prefix+this.state.tag.value;var n,i,r=this.state.selection||window.getSelection(),s=r.anchorNode,a=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return s.splitText(r.anchorOffset-a),(n=s.nodeValue.lastIndexOf(t))==-1||(i=s.splitText(n),e&&s.parentNode.replaceChild(e,i)),!0}},prepareNewTagNode:function(e,t){t=t||{};var n=this.settings,i=[],r={},s=Object.assign({},e,{value:e.value+""});if(e=Object.assign({},s),n.transformTag.call(this,e),e.__isValid=this.hasMaxTags()||this.validateTag(e),e.__isValid!==!0){if(t.skipInvalid)return;if(Oe(r,this.getInvalidTagAttrs(e,e.__isValid),{__preInvalidData:s}),e.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(e.value)),!n.createInvalidTags)return void i.push(e.value)}return"readonly"in e&&(e.readonly?r["aria-readonly"]=!0:delete e.readonly),{tagElm:this.createTagElem(e,r),tagData:e,aggregatedInvalidInput:i}},postProcessNewTagNode:function(e,t){var n=this,i=this.settings,r=t.__isValid;r&&r===!0?this.value.push(t):(this.trigger("invalid",{data:t,index:this.value.length,tag:e,message:r}),i.keepInvalidTags||setTimeout(function(){return n.removeTags(e,!0)},1e3)),this.dropdown.position()},selectTag:function(e,t){var n=this;if(!this.settings.enforceWhitelist||this.isTagWhitelisted(t.value)){this.state.actions.selectOption&&setTimeout(function(){return n.setRangeAtStartEnd(!1,n.DOM.input)});var i=this.getLastTag();return i?this.replaceTag(i,t):this.appendTag(e),this.value[0]=t,this.update(),this.trigger("add",{tag:e,data:t}),[e]}},addEmptyTag:function(e){var t=Oe({value:""},e||{}),n=this.createTagElem(t);Zt(n,t),this.appendTag(n),this.editTag(n,{skipValidation:!0}),this.toggleFocusClass(!0)},addTags:function(e,t,n){var i=this,r=[],s=this.settings,a=[],l=document.createDocumentFragment(),u=[];if(!e||e.length==0)return r;switch(e=this.normalizeTags(e),s.mode){case"mix":return this.addMixTags(e);case"select":t=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),e.forEach(function(h){var d=i.prepareNewTagNode(h,{skipInvalid:n||s.skipInvalid});if(d){var m=d.tagElm;if(h=d.tagData,a=d.aggregatedInvalidInput,r.push(m),s.mode=="select")return i.selectTag(m,h);l.appendChild(m),i.postProcessNewTagNode(m,h),u.push({tagElm:m,tagData:h})}}),this.appendTag(l),u.forEach(function(h){var d=h.tagElm,m=h.tagData;return i.trigger("add",{tag:d,index:i.getTagIdx(m),data:m})}),this.update(),e.length&&t&&(this.input.set.call(this,s.createInvalidTags?"":a.join(s._delimiters)),this.setRangeAtStartEnd(!1,this.DOM.input)),this.dropdown.refilter(),r},addMixTags:function(e){var t=this;if((e=this.normalizeTags(e))[0].prefix||this.state.tag)return this.prefixedTextToTag(e[0]);var n=document.createDocumentFragment();return e.forEach(function(i){var r=t.prepareNewTagNode(i);n.appendChild(r.tagElm),t.insertAfterTag(r.tagElm),t.postProcessNewTagNode(r.tagElm,r.tagData)}),this.appendMixTags(n),n.children},appendMixTags:function(e){var t=!!this.state.selection;t?this.injectAtCaret(e):(this.DOM.input.focus(),(t=this.setStateSelection()).range.setStart(this.DOM.input,t.range.endOffset),t.range.setEnd(this.DOM.input,t.range.endOffset),this.DOM.input.appendChild(e),this.updateValueByDOMTags(),this.update())},prefixedTextToTag:function(e){var t,n,i,r=this,s=this.settings,a=(t=this.state.tag)===null||t===void 0?void 0:t.delimiters;if(e.prefix=e.prefix||this.state.tag?this.state.tag.prefix:(s.pattern.source||s.pattern)[0],i=this.prepareNewTagNode(e),n=i.tagElm,this.replaceTextWithNode(n)||this.DOM.input.appendChild(n),setTimeout(function(){return n.classList.add(r.settings.classNames.tagNoAnimation)},300),this.update(),!a){var l=this.insertAfterTag(n)||n;setTimeout(Wi,0,l)}return this.state.tag=null,this.postProcessNewTagNode(n,i.tagData),n},appendTag:function(e){var t=this.DOM,n=t.input;t.scope.insertBefore(e,n)},createTagElem:function(e,t){e.__tagId=Yg();var n,i=Oe({},e,Qg({value:wr(e.value+"")},t));return function(r){for(var s,a=document.createNodeIterator(r,NodeFilter.SHOW_TEXT,null,!1);s=a.nextNode();)s.textContent.trim()||s.parentNode.removeChild(s)}(n=this.parseTemplate("tag",[i,this])),Zt(n,e),n},reCheckInvalidTags:function(){var e=this,t=this.settings;this.getTagElms(t.classNames.tagNotAllowed).forEach(function(n,i){var r=Zt(n),s=e.hasMaxTags(),a=e.validateTag(r),l=a===!0&&!s;if(t.mode=="select"&&e.toggleScopeValidation(a),l)return r=r.__preInvalidData?r.__preInvalidData:{value:r.value},e.replaceTag(n,r);n.title=s||a})},removeTags:function(e,t,n){var i,r=this,s=this.settings;if(e=e&&yi(e,HTMLElement)?[e]:yi(e,Array)?e:e?[e]:[this.getLastTag()].filter(function(a){return a}),i=e.reduce(function(a,l){l&&typeof l=="string"&&(l=r.getTagElmByValue(l));var u=Zt(l);return l&&u&&!u.readonly&&a.push({node:l,idx:r.getTagIdx(u),data:Zt(l,{__removed:!0})}),a},[]),n=typeof n=="number"?n:this.CSSVars.tagHideTransition,s.mode=="select"&&(n=0,this.input.set.call(this)),i.length==1&&s.mode!="select"&&i[0].node.classList.contains(s.classNames.tagNotAllowed)&&(t=!0),i.length)return s.hooks.beforeRemoveTag(i,{tagify:this}).then(function(){var a=function(l){l.node.parentNode&&(l.node.parentNode.removeChild(l.node),t?s.keepInvalidTags&&this.trigger("remove",{tag:l.node,index:l.idx}):(this.trigger("remove",{tag:l.node,index:l.idx,data:l.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),s.keepInvalidTags&&this.reCheckInvalidTags()))};n&&n>10&&i.length==1?(function(l){l.node.style.width=parseFloat(window.getComputedStyle(l.node).width)+"px",document.body.clientTop,l.node.classList.add(s.classNames.tagHide),setTimeout(a.bind(this),n,l)}).call(r,i[0]):i.forEach(a.bind(r)),t||(r.removeTagsFromValue(i.map(function(l){return l.node})),r.update(),s.mode=="select"&&s.userInput&&r.setContentEditable(!0))}).catch(function(a){})},removeTagsFromDOM:function(){this.getTagElms().forEach(function(e){return e.remove()})},removeTagsFromValue:function(e){var t=this;(e=Array.isArray(e)?e:[e]).forEach(function(n){var i=Zt(n),r=t.getTagIdx(i);r>-1&&t.value.splice(r,1)})},removeAllTags:function(e){var t=this;e=e||{},this.value=[],this.settings.mode=="mix"?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout(function(){t.DOM.input.focus()}),this.settings.mode=="select"&&(this.input.set.call(this),this.settings.userInput&&this.setContentEditable(!0)),this.update(e)},postUpdate:function(){this.state.blockChangeEvent=!1;var e,t,n=this.settings,i=n.classNames,r=n.mode=="mix"?n.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(i.hasMaxTags,this.value.length>=n.maxTags),this.toggleClass(i.hasNoTags,!this.value.length),this.toggleClass(i.empty,!r),n.mode=="select"&&this.toggleScopeValidation((t=this.value)===null||t===void 0||(e=t[0])===null||e===void 0?void 0:e.__isValid)},setOriginalInputValue:function(e){var t=this.DOM.originalInput;this.settings.mixMode.integrated||(t.value=e,t.tagifyValue=t.value,this.setPersistedData(e,"value"))},update:function(e){clearTimeout(this.debouncedUpdateTimeout),this.debouncedUpdateTimeout=setTimeout((function(){var t=this.getInputValue();this.setOriginalInputValue(t),this.settings.onChangeAfterBlur&&(e||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent(),this.postUpdate()}).bind(this),100),this.events.bindOriginaInputListener.call(this,100)},getInputValue:function(){var e=this.getCleanValue();return this.settings.mode=="mix"?this.getMixedTagsAsString(e):e.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(e):JSON.stringify(e):""},getCleanValue:function(e){return Ug(e||this.value,this.dataProps)},getMixedTagsAsString:function(){var e="",t=this,n=this.settings,i=n.originalInputValueFormat||JSON.stringify,r=n.mixTagsInterpolator;return function s(a){a.childNodes.forEach(function(l){if(l.nodeType==1){var u=Zt(l);if(l.tagName=="BR"&&(e+=`\r
`),u&&Tr.call(t,l)){if(u.__removed)return;e+=r[0]+i(mf(u,t.dataProps))+r[1]}else l.getAttribute("style")||["B","I","U"].includes(l.tagName)?e+=l.textContent:l.tagName!="DIV"&&l.tagName!="P"||(e+=`\r
`,s(l))}else e+=l.textContent})}(this.DOM.input),e}},Ql.prototype.removeTag=Ql.prototype.removeTags;function Io(e){"@babel/helpers - typeof";return Io=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},Io(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mk(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Re(e,t,n){return t&&mk(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $o(){return $o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$o.apply(this,arguments)}function fn(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&&bf(e,t)}function dc(e){return dc=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},dc(e)}function bf(e,t){return bf=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},bf(e,t)}function vk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yk(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bk(e)}function dn(e){var t=vk();return function(){var i=dc(e),r;if(t){var s=dc(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return yk(this,r)}}var Zf=function(){function e(){Me(this,e)}return Re(e,[{key:"listenForWhisper",value:function(n,i){return this.listen(".client-"+n,i)}},{key:"notification",value:function(n){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",n)}},{key:"stopListeningForWhisper",value:function(n,i){return this.stopListening(".client-"+n,i)}}]),e}(),Eb=function(){function e(t){Me(this,e),this.namespace=t}return Re(e,[{key:"format",value:function(n){return[".","\\"].includes(n.charAt(0))?n.substring(1):(this.namespace&&(n=this.namespace+"."+n),n.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(n){this.namespace=n}}]),e}();function _k(e){try{new e}catch(t){if(t.message.includes("is not a constructor"))return!1}return!0}var Qf=function(e){fn(n,e);var t=dn(n);function n(i,r,s){var a;return Me(this,n),a=t.call(this),a.name=r,a.pusher=i,a.options=s,a.eventFormatter=new Eb(a.options.namespace),a.subscribe(),a}return Re(n,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(r,s){return this.on(this.eventFormatter.format(r),s),this}},{key:"listenToAll",value:function(r){var s=this;return this.subscription.bind_global(function(a,l){if(!a.startsWith("pusher:")){var u=s.options.namespace.replace(/\./g,"\\"),h=a.startsWith(u)?a.substring(u.length+1):"."+a;r(h,l)}}),this}},{key:"stopListening",value:function(r,s){return s?this.subscription.unbind(this.eventFormatter.format(r),s):this.subscription.unbind(this.eventFormatter.format(r)),this}},{key:"stopListeningToAll",value:function(r){return r?this.subscription.unbind_global(r):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(r){return this.on("pusher:subscription_succeeded",function(){r()}),this}},{key:"error",value:function(r){return this.on("pusher:subscription_error",function(s){r(s)}),this}},{key:"on",value:function(r,s){return this.subscription.bind(r,s),this}}]),n}(Zf),Pb=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}}]),n}(Qf),wk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}}]),n}(Qf),xk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"here",value:function(r){return this.on("pusher:subscription_succeeded",function(s){r(Object.keys(s.members).map(function(a){return s.members[a]}))}),this}},{key:"joining",value:function(r){return this.on("pusher:member_added",function(s){r(s.info)}),this}},{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}},{key:"leaving",value:function(r){return this.on("pusher:member_removed",function(s){r(s.info)}),this}}]),n}(Pb),Mb=function(e){fn(n,e);var t=dn(n);function n(i,r,s){var a;return Me(this,n),a=t.call(this),a.events={},a.listeners={},a.name=r,a.socket=i,a.options=s,a.eventFormatter=new Eb(a.options.namespace),a.subscribe(),a}return Re(n,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(r,s){return this.on(this.eventFormatter.format(r),s),this}},{key:"stopListening",value:function(r,s){return this.unbindEvent(this.eventFormatter.format(r),s),this}},{key:"subscribed",value:function(r){return this.on("connect",function(s){r(s)}),this}},{key:"error",value:function(r){return this}},{key:"on",value:function(r,s){var a=this;return this.listeners[r]=this.listeners[r]||[],this.events[r]||(this.events[r]=function(l,u){a.name===l&&a.listeners[r]&&a.listeners[r].forEach(function(h){return h(u)})},this.socket.on(r,this.events[r])),this.listeners[r].push(s),this}},{key:"unbind",value:function(){var r=this;Object.keys(this.events).forEach(function(s){r.unbindEvent(s)})}},{key:"unbindEvent",value:function(r,s){this.listeners[r]=this.listeners[r]||[],s&&(this.listeners[r]=this.listeners[r].filter(function(a){return a!==s})),(!s||this.listeners[r].length===0)&&(this.events[r]&&(this.socket.removeListener(r,this.events[r]),delete this.events[r]),delete this.listeners[r])}}]),n}(Zf),Rb=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(r),data:s}),this}}]),n}(Mb),Sk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"here",value:function(r){return this.on("presence:subscribed",function(s){r(s.map(function(a){return a.user_info}))}),this}},{key:"joining",value:function(r){return this.on("presence:joining",function(s){return r(s.user_info)}),this}},{key:"whisper",value:function(r,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(r),data:s}),this}},{key:"leaving",value:function(r){return this.on("presence:leaving",function(s){return r(s.user_info)}),this}}]),n}(Rb),pc=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(r,s){return this}},{key:"listenToAll",value:function(r){return this}},{key:"stopListening",value:function(r,s){return this}},{key:"subscribed",value:function(r){return this}},{key:"error",value:function(r){return this}},{key:"on",value:function(r,s){return this}}]),n}(Zf),Db=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this}}]),n}(pc),Tk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this}}]),n}(pc),Ck=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"here",value:function(r){return this}},{key:"joining",value:function(r){return this}},{key:"whisper",value:function(r,s){return this}},{key:"leaving",value:function(r){return this}}]),n}(Db),td=function(){function e(t){Me(this,e),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(t),this.connect()}return Re(e,[{key:"setOptions",value:function(n){this.options=$o(this._defaultOptions,n);var i=this.csrfToken();return i&&(this.options.auth.headers["X-CSRF-TOKEN"]=i,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=i),i=this.options.bearerToken,i&&(this.options.auth.headers.Authorization="Bearer "+i,this.options.userAuthentication.headers.Authorization="Bearer "+i),n}},{key:"csrfToken",value:function(){var n;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(n=document.querySelector('meta[name="csrf-token"]'))?n.getAttribute("content"):null}}]),e}(),tm=function(e){fn(n,e);var t=dn(n);function n(){var i;return Me(this,n),i=t.apply(this,arguments),i.channels={},i}return Re(n,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(r,s,a){return this.channel(r).listen(s,a)}},{key:"channel",value:function(r){return this.channels[r]||(this.channels[r]=new Qf(this.pusher,r,this.options)),this.channels[r]}},{key:"privateChannel",value:function(r){return this.channels["private-"+r]||(this.channels["private-"+r]=new Pb(this.pusher,"private-"+r,this.options)),this.channels["private-"+r]}},{key:"encryptedPrivateChannel",value:function(r){return this.channels["private-encrypted-"+r]||(this.channels["private-encrypted-"+r]=new wk(this.pusher,"private-encrypted-"+r,this.options)),this.channels["private-encrypted-"+r]}},{key:"presenceChannel",value:function(r){return this.channels["presence-"+r]||(this.channels["presence-"+r]=new xk(this.pusher,"presence-"+r,this.options)),this.channels["presence-"+r]}},{key:"leave",value:function(r){var s=this,a=[r,"private-"+r,"private-encrypted-"+r,"presence-"+r];a.forEach(function(l,u){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(r){this.channels[r]&&(this.channels[r].unsubscribe(),delete this.channels[r])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),n}(td),em=function(e){fn(n,e);var t=dn(n);function n(){var i;return Me(this,n),i=t.apply(this,arguments),i.channels={},i}return Re(n,[{key:"connect",value:function(){var r=this,s=this.getSocketIO();return this.socket=s(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(r.channels).forEach(function(a){a.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(r,s,a){return this.channel(r).listen(s,a)}},{key:"channel",value:function(r){return this.channels[r]||(this.channels[r]=new Mb(this.socket,r,this.options)),this.channels[r]}},{key:"privateChannel",value:function(r){return this.channels["private-"+r]||(this.channels["private-"+r]=new Rb(this.socket,"private-"+r,this.options)),this.channels["private-"+r]}},{key:"presenceChannel",value:function(r){return this.channels["presence-"+r]||(this.channels["presence-"+r]=new Sk(this.socket,"presence-"+r,this.options)),this.channels["presence-"+r]}},{key:"leave",value:function(r){var s=this,a=[r,"private-"+r,"presence-"+r];a.forEach(function(l){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(r){this.channels[r]&&(this.channels[r].unsubscribe(),delete this.channels[r])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),n}(td),Ok=function(e){fn(n,e);var t=dn(n);function n(){var i;return Me(this,n),i=t.apply(this,arguments),i.channels={},i}return Re(n,[{key:"connect",value:function(){}},{key:"listen",value:function(r,s,a){return new pc}},{key:"channel",value:function(r){return new pc}},{key:"privateChannel",value:function(r){return new Db}},{key:"encryptedPrivateChannel",value:function(r){return new Tk}},{key:"presenceChannel",value:function(r){return new Ck}},{key:"leave",value:function(r){}},{key:"leaveChannel",value:function(r){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),n}(td),kk=function(){function e(t){Me(this,e),this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return Re(e,[{key:"channel",value:function(n){return this.connector.channel(n)}},{key:"connect",value:function(){if(this.options.broadcaster=="reverb")this.connector=new tm($o($o({},this.options),{cluster:""}));else if(this.options.broadcaster=="pusher")this.connector=new tm(this.options);else if(this.options.broadcaster=="socket.io")this.connector=new em(this.options);else if(this.options.broadcaster=="null")this.connector=new Ok(this.options);else if(typeof this.options.broadcaster=="function"&&_k(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error("Broadcaster ".concat(Io(this.options.broadcaster)," ").concat(this.options.broadcaster," is not supported."))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(n){return this.connector.presenceChannel(n)}},{key:"leave",value:function(n){this.connector.leave(n)}},{key:"leaveChannel",value:function(n){this.connector.leaveChannel(n)}},{key:"leaveAllChannels",value:function(){for(var n in this.connector.channels)this.leaveChannel(n)}},{key:"listen",value:function(n,i,r){return this.connector.listen(n,i,r)}},{key:"private",value:function(n){return this.connector.privateChannel(n)}},{key:"encryptedPrivate",value:function(n){if(this.connector instanceof em)throw new Error("Broadcaster ".concat(Io(this.options.broadcaster)," ").concat(this.options.broadcaster," does not support encrypted private channels."));return this.connector.encryptedPrivateChannel(n)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":Io(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var n=this;Vue.http.interceptors.push(function(i,r){n.socketId()&&i.headers.set("X-Socket-ID",n.socketId()),r()})}},{key:"registerAxiosRequestInterceptor",value:function(){var n=this;axios.interceptors.request.use(function(i){return n.socketId()&&(i.headers["X-Socket-Id"]=n.socketId()),i})}},{key:"registerjQueryAjaxSetup",value:function(){var n=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(i,r,s){n.socketId()&&s.setRequestHeader("X-Socket-Id",n.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var n=this;document.addEventListener("turbo:before-fetch-request",function(i){i.detail.fetchOptions.headers["X-Socket-Id"]=n.socketId()})}}]),e}(),Wh={exports:{}};/*!
* Pusher JavaScript Library v7.6.0
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/var nm;function Ak(){return nm||(nm=1,function(e,t){(function(i,r){e.exports=r()})(window,function(){return function(n){var i={};function r(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return n[s].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=n,r.c=i,r.d=function(s,a,l){r.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,a){if(a&1&&(s=r(s)),a&8||a&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),a&2&&typeof s!="string")for(var u in s)r.d(l,u,(function(h){return s[h]}).bind(null,u));return l},r.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(a,"a",a),a},r.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},r.p="",r(r.s=2)}([function(n,i,r){var s=this&&this.__extends||function(){var C=function(T,A){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,B){M.__proto__=B}||function(M,B){for(var D in B)B.hasOwnProperty(D)&&(M[D]=B[D])},C(T,A)};return function(T,A){C(T,A);function M(){this.constructor=T}T.prototype=A===null?Object.create(A):(M.prototype=A.prototype,new M)}}();Object.defineProperty(i,"__esModule",{value:!0});var a=256,l=function(){function C(T){T===void 0&&(T="="),this._paddingCharacter=T}return C.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},C.prototype.encode=function(T){for(var A="",M=0;M<T.length-2;M+=3){var B=T[M]<<16|T[M+1]<<8|T[M+2];A+=this._encodeByte(B>>>3*6&63),A+=this._encodeByte(B>>>2*6&63),A+=this._encodeByte(B>>>1*6&63),A+=this._encodeByte(B>>>0*6&63)}var D=T.length-M;if(D>0){var B=T[M]<<16|(D===2?T[M+1]<<8:0);A+=this._encodeByte(B>>>3*6&63),A+=this._encodeByte(B>>>2*6&63),D===2?A+=this._encodeByte(B>>>1*6&63):A+=this._paddingCharacter||"",A+=this._paddingCharacter||""}return A},C.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},C.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},C.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var A=this._getPaddingLength(T),M=T.length-A,B=new Uint8Array(this.maxDecodedLength(M)),D=0,R=0,N=0,I=0,j=0,q=0,F=0;R<M-4;R+=4)I=this._decodeChar(T.charCodeAt(R+0)),j=this._decodeChar(T.charCodeAt(R+1)),q=this._decodeChar(T.charCodeAt(R+2)),F=this._decodeChar(T.charCodeAt(R+3)),B[D++]=I<<2|j>>>4,B[D++]=j<<4|q>>>2,B[D++]=q<<6|F,N|=I&a,N|=j&a,N|=q&a,N|=F&a;if(R<M-1&&(I=this._decodeChar(T.charCodeAt(R)),j=this._decodeChar(T.charCodeAt(R+1)),B[D++]=I<<2|j>>>4,N|=I&a,N|=j&a),R<M-2&&(q=this._decodeChar(T.charCodeAt(R+2)),B[D++]=j<<4|q>>>2,N|=q&a),R<M-3&&(F=this._decodeChar(T.charCodeAt(R+3)),B[D++]=q<<6|F,N|=F&a),N!==0)throw new Error("Base64Coder: incorrect characters for decoding");return B},C.prototype._encodeByte=function(T){var A=T;return A+=65,A+=25-T>>>8&6,A+=51-T>>>8&-75,A+=61-T>>>8&-15,A+=62-T>>>8&3,String.fromCharCode(A)},C.prototype._decodeChar=function(T){var A=a;return A+=(42-T&T-44)>>>8&-a+T-43+62,A+=(46-T&T-48)>>>8&-a+T-47+63,A+=(47-T&T-58)>>>8&-a+T-48+52,A+=(64-T&T-91)>>>8&-a+T-65+0,A+=(96-T&T-123)>>>8&-a+T-97+26,A},C.prototype._getPaddingLength=function(T){var A=0;if(this._paddingCharacter){for(var M=T.length-1;M>=0&&T[M]===this._paddingCharacter;M--)A++;if(T.length<4||A>2)throw new Error("Base64Coder: incorrect padding")}return A},C}();i.Coder=l;var u=new l;function h(C){return u.encode(C)}i.encode=h;function d(C){return u.decode(C)}i.decode=d;var m=function(C){s(T,C);function T(){return C!==null&&C.apply(this,arguments)||this}return T.prototype._encodeByte=function(A){var M=A;return M+=65,M+=25-A>>>8&6,M+=51-A>>>8&-75,M+=61-A>>>8&-13,M+=62-A>>>8&49,String.fromCharCode(M)},T.prototype._decodeChar=function(A){var M=a;return M+=(44-A&A-46)>>>8&-a+A-45+62,M+=(94-A&A-96)>>>8&-a+A-95+63,M+=(47-A&A-58)>>>8&-a+A-48+52,M+=(64-A&A-91)>>>8&-a+A-65+0,M+=(96-A&A-123)>>>8&-a+A-97+26,M},T}(l);i.URLSafeCoder=m;var y=new m;function x(C){return y.encode(C)}i.encodeURLSafe=x;function S(C){return y.decode(C)}i.decodeURLSafe=S,i.encodedLength=function(C){return u.encodedLength(C)},i.maxDecodedLength=function(C){return u.maxDecodedLength(C)},i.decodedLength=function(C){return u.decodedLength(C)}},function(n,i,r){Object.defineProperty(i,"__esModule",{value:!0});var s="utf8: invalid string",a="utf8: invalid source encoding";function l(d){for(var m=new Uint8Array(u(d)),y=0,x=0;x<d.length;x++){var S=d.charCodeAt(x);S<128?m[y++]=S:S<2048?(m[y++]=192|S>>6,m[y++]=128|S&63):S<55296?(m[y++]=224|S>>12,m[y++]=128|S>>6&63,m[y++]=128|S&63):(x++,S=(S&1023)<<10,S|=d.charCodeAt(x)&1023,S+=65536,m[y++]=240|S>>18,m[y++]=128|S>>12&63,m[y++]=128|S>>6&63,m[y++]=128|S&63)}return m}i.encode=l;function u(d){for(var m=0,y=0;y<d.length;y++){var x=d.charCodeAt(y);if(x<128)m+=1;else if(x<2048)m+=2;else if(x<55296)m+=3;else if(x<=57343){if(y>=d.length-1)throw new Error(s);y++,m+=4}else throw new Error(s)}return m}i.encodedLength=u;function h(d){for(var m=[],y=0;y<d.length;y++){var x=d[y];if(x&128){var S=void 0;if(x<224){if(y>=d.length)throw new Error(a);var C=d[++y];if((C&192)!==128)throw new Error(a);x=(x&31)<<6|C&63,S=128}else if(x<240){if(y>=d.length-1)throw new Error(a);var C=d[++y],T=d[++y];if((C&192)!==128||(T&192)!==128)throw new Error(a);x=(x&15)<<12|(C&63)<<6|T&63,S=2048}else if(x<248){if(y>=d.length-2)throw new Error(a);var C=d[++y],T=d[++y],A=d[++y];if((C&192)!==128||(T&192)!==128||(A&192)!==128)throw new Error(a);x=(x&15)<<18|(C&63)<<12|(T&63)<<6|A&63,S=65536}else throw new Error(a);if(x<S||x>=55296&&x<=57343)throw new Error(a);if(x>=65536){if(x>1114111)throw new Error(a);x-=65536,m.push(String.fromCharCode(55296|x>>10)),x=56320|x&1023}}m.push(String.fromCharCode(x))}return m.join("")}i.decode=h},function(n,i,r){n.exports=r(3).default},function(n,i,r){r.r(i);var s=function(){function v(p,g){this.lastId=0,this.prefix=p,this.name=g}return v.prototype.create=function(p){this.lastId++;var g=this.lastId,b=this.prefix+g,w=this.name+"["+g+"]",O=!1,W=function(){O||(p.apply(null,arguments),O=!0)};return this[g]=W,{number:g,id:b,name:w,callback:W}},v.prototype.remove=function(p){delete this[p.number]},v}(),a=new s("_pusher_script_","Pusher.ScriptReceivers"),l={VERSION:"7.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},u=l,h=function(){function v(p){this.options=p,this.receivers=p.receivers||a,this.loading={}}return v.prototype.load=function(p,g,b){var w=this;if(w.loading[p]&&w.loading[p].length>0)w.loading[p].push(b);else{w.loading[p]=[b];var O=yt.createScriptRequest(w.getPath(p,g)),W=w.receivers.create(function(Y){if(w.receivers.remove(W),w.loading[p]){var rt=w.loading[p];delete w.loading[p];for(var nt=function(ee){ee||O.cleanup()},ut=0;ut<rt.length;ut++)rt[ut](Y,nt)}});O.send(W)}},v.prototype.getRoot=function(p){var g,b=yt.getDocument().location.protocol;return p&&p.useTLS||b==="https:"?g=this.options.cdn_https:g=this.options.cdn_http,g.replace(/\/*$/,"")+"/"+this.options.version},v.prototype.getPath=function(p,g){return this.getRoot(g)+"/"+p+this.options.suffix+".js"},v}(),d=h,m=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),y=new d({cdn_http:u.cdn_http,cdn_https:u.cdn_https,version:u.VERSION,suffix:u.dependency_suffix,receivers:m}),x={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},S=function(v){var p="See:",g=x.urls[v];if(!g)return"";var b;return g.fullUrl?b=g.fullUrl:g.path&&(b=x.baseUrl+g.path),b?p+" "+b:""},C={buildLogSuffix:S},T;(function(v){v.UserAuthentication="user-authentication",v.ChannelAuthorization="channel-authorization"})(T||(T={}));var A=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),M=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),B=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),D=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),R=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),N=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),I=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),j=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),q=function(v){A(p,v);function p(g){var b=this.constructor,w=v.call(this,g)||this;return Object.setPrototypeOf(w,b.prototype),w}return p}(Error),F=function(v){A(p,v);function p(g,b){var w=this.constructor,O=v.call(this,b)||this;return O.status=g,Object.setPrototypeOf(O,w.prototype),O}return p}(Error),H=function(v,p,g,b,w){var O=yt.createXHR();O.open("POST",g.endpoint,!0),O.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var W in g.headers)O.setRequestHeader(W,g.headers[W]);if(g.headersProvider!=null){var Y=g.headersProvider();for(var W in Y)O.setRequestHeader(W,Y[W])}return O.onreadystatechange=function(){if(O.readyState===4)if(O.status===200){var rt=void 0,nt=!1;try{rt=JSON.parse(O.responseText),nt=!0}catch{w(new F(200,"JSON returned from "+b.toString()+" endpoint was invalid, yet status code was 200. Data was: "+O.responseText),null)}nt&&w(null,rt)}else{var ut="";switch(b){case T.UserAuthentication:ut=C.buildLogSuffix("authenticationEndpoint");break;case T.ChannelAuthorization:ut="Clients must be authorized to join private or presence channels. "+C.buildLogSuffix("authorizationEndpoint");break}w(new F(O.status,"Unable to retrieve auth string from "+b.toString()+" endpoint - "+("received status: "+O.status+" from "+g.endpoint+". "+ut)),null)}},O.send(p),O},U=H;function V(v){return dt(K(v))}var st=String.fromCharCode,tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",it=function(v){var p=v.charCodeAt(0);return p<128?v:p<2048?st(192|p>>>6)+st(128|p&63):st(224|p>>>12&15)+st(128|p>>>6&63)+st(128|p&63)},K=function(v){return v.replace(/[^\x00-\x7F]/g,it)},ct=function(v){var p=[0,2,1][v.length%3],g=v.charCodeAt(0)<<16|(v.length>1?v.charCodeAt(1):0)<<8|(v.length>2?v.charCodeAt(2):0),b=[tt.charAt(g>>>18),tt.charAt(g>>>12&63),p>=2?"=":tt.charAt(g>>>6&63),p>=1?"=":tt.charAt(g&63)];return b.join("")},dt=window.btoa||function(v){return v.replace(/[\s\S]{1,3}/g,ct)},_t=function(){function v(p,g,b,w){var O=this;this.clear=g,this.timer=p(function(){O.timer&&(O.timer=w(O.timer))},b)}return v.prototype.isRunning=function(){return this.timer!==null},v.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},v}(),wt=_t,vt=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}();function Ft(v){window.clearTimeout(v)}function xt(v){window.clearInterval(v)}var Ct=function(v){vt(p,v);function p(g,b){return v.call(this,setTimeout,Ft,g,function(w){return b(),null})||this}return p}(wt),Nt=function(v){vt(p,v);function p(g,b){return v.call(this,setInterval,xt,g,function(w){return b(),w})||this}return p}(wt),be={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(v){return new Ct(0,v)},method:function(v){var p=Array.prototype.slice.call(arguments,1);return function(g){return g[v].apply(g,p.concat(arguments))}}},Ot=be;function St(v){for(var p=[],g=1;g<arguments.length;g++)p[g-1]=arguments[g];for(var b=0;b<p.length;b++){var w=p[b];for(var O in w)w[O]&&w[O].constructor&&w[O].constructor===Object?v[O]=St(v[O]||{},w[O]):v[O]=w[O]}return v}function In(){for(var v=["Pusher"],p=0;p<arguments.length;p++)typeof arguments[p]=="string"?v.push(arguments[p]):v.push(Se(arguments[p]));return v.join(" : ")}function De(v,p){var g=Array.prototype.indexOf;if(v===null)return-1;if(g&&v.indexOf===g)return v.indexOf(p);for(var b=0,w=v.length;b<w;b++)if(v[b]===p)return b;return-1}function te(v,p){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&p(v[g],g,v)}function Le(v){var p=[];return te(v,function(g,b){p.push(b)}),p}function re(v){var p=[];return te(v,function(g){p.push(g)}),p}function oe(v,p,g){for(var b=0;b<v.length;b++)p.call(g||window,v[b],b,v)}function we(v,p){for(var g=[],b=0;b<v.length;b++)g.push(p(v[b],b,v,g));return g}function ye(v,p){var g={};return te(v,function(b,w){g[w]=p(b)}),g}function Ve(v,p){p=p||function(w){return!!w};for(var g=[],b=0;b<v.length;b++)p(v[b],b,v,g)&&g.push(v[b]);return g}function wn(v,p){var g={};return te(v,function(b,w){(p&&p(b,w,v,g)||b)&&(g[w]=b)}),g}function he(v){var p=[];return te(v,function(g,b){p.push([b,g])}),p}function Xt(v,p){for(var g=0;g<v.length;g++)if(p(v[g],g,v))return!0;return!1}function xe(v,p){for(var g=0;g<v.length;g++)if(!p(v[g],g,v))return!1;return!0}function Ae(v){return ye(v,function(p){return typeof p=="object"&&(p=Se(p)),encodeURIComponent(V(p.toString()))})}function xn(v){var p=wn(v,function(b){return b!==void 0}),g=we(he(Ae(p)),Ot.method("join","=")).join("&");return g}function Yt(v){var p=[],g=[];return function b(w,O){var W,Y,rt;switch(typeof w){case"object":if(!w)return null;for(W=0;W<p.length;W+=1)if(p[W]===w)return{$ref:g[W]};if(p.push(w),g.push(O),Object.prototype.toString.apply(w)==="[object Array]")for(rt=[],W=0;W<w.length;W+=1)rt[W]=b(w[W],O+"["+W+"]");else{rt={};for(Y in w)Object.prototype.hasOwnProperty.call(w,Y)&&(rt[Y]=b(w[Y],O+"["+JSON.stringify(Y)+"]"))}return rt;case"number":case"string":case"boolean":return w}}(v,"$")}function Se(v){try{return JSON.stringify(v)}catch{return JSON.stringify(Yt(v))}}var fe=function(){function v(){this.globalLog=function(p){window.console&&window.console.log&&window.console.log(p)}}return v.prototype.debug=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];this.log(this.globalLog,p)},v.prototype.warn=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];this.log(this.globalLogWarn,p)},v.prototype.error=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];this.log(this.globalLogError,p)},v.prototype.globalLogWarn=function(p){window.console&&window.console.warn?window.console.warn(p):this.globalLog(p)},v.prototype.globalLogError=function(p){window.console&&window.console.error?window.console.error(p):this.globalLogWarn(p)},v.prototype.log=function(p){var g=In.apply(this,arguments);if(qs.log)qs.log(g);else if(qs.logToConsole){var b=p.bind(this);b(g)}},v}(),Z=new fe,et=function(v,p,g,b,w){(g.headers!==void 0||g.headersProvider!=null)&&Z.warn("To send headers with the "+b.toString()+" request, you must use AJAX, rather than JSONP.");var O=v.nextAuthCallbackID.toString();v.nextAuthCallbackID++;var W=v.getDocument(),Y=W.createElement("script");v.auth_callbacks[O]=function(ut){w(null,ut)};var rt="Pusher.auth_callbacks['"+O+"']";Y.src=g.endpoint+"?callback="+encodeURIComponent(rt)+"&"+p;var nt=W.getElementsByTagName("head")[0]||W.documentElement;nt.insertBefore(Y,nt.firstChild)},ht=et,lt=function(){function v(p){this.src=p}return v.prototype.send=function(p){var g=this,b="Error loading "+g.src;g.script=document.createElement("script"),g.script.id=p.id,g.script.src=g.src,g.script.type="text/javascript",g.script.charset="UTF-8",g.script.addEventListener?(g.script.onerror=function(){p.callback(b)},g.script.onload=function(){p.callback(null)}):g.script.onreadystatechange=function(){(g.script.readyState==="loaded"||g.script.readyState==="complete")&&p.callback(null)},g.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(g.errorScript=document.createElement("script"),g.errorScript.id=p.id+"_error",g.errorScript.text=p.name+"('"+b+"');",g.script.async=g.errorScript.async=!1):g.script.async=!0;var w=document.getElementsByTagName("head")[0];w.insertBefore(g.script,w.firstChild),g.errorScript&&w.insertBefore(g.errorScript,g.script.nextSibling)},v.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},v}(),Bt=lt,jt=function(){function v(p,g){this.url=p,this.data=g}return v.prototype.send=function(p){if(!this.request){var g=xn(this.data),b=this.url+"/"+p.number+"?"+g;this.request=yt.createScriptRequest(b),this.request.send(p)}},v.prototype.cleanup=function(){this.request&&this.request.cleanup()},v}(),de=jt,Ie=function(v,p){return function(g,b){var w="http"+(p?"s":"")+"://",O=w+(v.host||v.options.host)+v.options.path,W=yt.createJSONPRequest(O,g),Y=yt.ScriptReceivers.create(function(rt,nt){a.remove(Y),W.cleanup(),nt&&nt.host&&(v.host=nt.host),b&&b(rt,nt)});W.send(Y)}},qe={name:"jsonp",getAgent:Ie},Ne=qe;function Zi(v,p,g){var b=v+(p.useTLS?"s":""),w=p.useTLS?p.hostTLS:p.hostNonTLS;return b+"://"+w+g}function Qi(v,p){var g="/app/"+v,b="?protocol="+u.PROTOCOL+"&client=js&version="+u.VERSION+(p?"&"+p:"");return g+b}var tr={getInitial:function(v,p){var g=(p.httpPath||"")+Qi(v,"flash=false");return Zi("ws",p,g)}},er={getInitial:function(v,p){var g=(p.httpPath||"/pusher")+Qi(v);return Zi("http",p,g)}},Fr={getInitial:function(v,p){return Zi("http",p,p.httpPath||"/pusher")},getPath:function(v,p){return Qi(v)}},Br=function(){function v(){this._callbacks={}}return v.prototype.get=function(p){return this._callbacks[$t(p)]},v.prototype.add=function(p,g,b){var w=$t(p);this._callbacks[w]=this._callbacks[w]||[],this._callbacks[w].push({fn:g,context:b})},v.prototype.remove=function(p,g,b){if(!p&&!g&&!b){this._callbacks={};return}var w=p?[$t(p)]:Le(this._callbacks);g||b?this.removeCallback(w,g,b):this.removeAllCallbacks(w)},v.prototype.removeCallback=function(p,g,b){oe(p,function(w){this._callbacks[w]=Ve(this._callbacks[w]||[],function(O){return g&&g!==O.fn||b&&b!==O.context}),this._callbacks[w].length===0&&delete this._callbacks[w]},this)},v.prototype.removeAllCallbacks=function(p){oe(p,function(g){delete this._callbacks[g]},this)},v}(),Nn=Br;function $t(v){return"_"+v}var _e=function(){function v(p){this.callbacks=new Nn,this.global_callbacks=[],this.failThrough=p}return v.prototype.bind=function(p,g,b){return this.callbacks.add(p,g,b),this},v.prototype.bind_global=function(p){return this.global_callbacks.push(p),this},v.prototype.unbind=function(p,g,b){return this.callbacks.remove(p,g,b),this},v.prototype.unbind_global=function(p){return p?(this.global_callbacks=Ve(this.global_callbacks||[],function(g){return g!==p}),this):(this.global_callbacks=[],this)},v.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},v.prototype.emit=function(p,g,b){for(var w=0;w<this.global_callbacks.length;w++)this.global_callbacks[w](p,g);var O=this.callbacks.get(p),W=[];if(b?W.push(g,b):g&&W.push(g),O&&O.length>0)for(var w=0;w<O.length;w++)O[w].fn.apply(O[w].context||window,W);else this.failThrough&&this.failThrough(p,g);return this},v}(),Sn=_e,Wc=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),jc=function(v){Wc(p,v);function p(g,b,w,O,W){var Y=v.call(this)||this;return Y.initialize=yt.transportConnectionInitializer,Y.hooks=g,Y.name=b,Y.priority=w,Y.key=O,Y.options=W,Y.state="new",Y.timeline=W.timeline,Y.activityTimeout=W.activityTimeout,Y.id=Y.timeline.generateUniqueID(),Y}return p.prototype.handlesActivityChecks=function(){return!!this.hooks.handlesActivityChecks},p.prototype.supportsPing=function(){return!!this.hooks.supportsPing},p.prototype.connect=function(){var g=this;if(this.socket||this.state!=="initialized")return!1;var b=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(b,this.options)}catch(w){return Ot.defer(function(){g.onError(w),g.changeState("closed")}),!1}return this.bindListeners(),Z.debug("Connecting",{transport:this.name,url:b}),this.changeState("connecting"),!0},p.prototype.close=function(){return this.socket?(this.socket.close(),!0):!1},p.prototype.send=function(g){var b=this;return this.state==="open"?(Ot.defer(function(){b.socket&&b.socket.send(g)}),!0):!1},p.prototype.ping=function(){this.state==="open"&&this.supportsPing()&&this.socket.ping()},p.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},p.prototype.onError=function(g){this.emit("error",{type:"WebSocketError",error:g}),this.timeline.error(this.buildTimelineMessage({error:g.toString()}))},p.prototype.onClose=function(g){g?this.changeState("closed",{code:g.code,reason:g.reason,wasClean:g.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},p.prototype.onMessage=function(g){this.emit("message",g)},p.prototype.onActivity=function(){this.emit("activity")},p.prototype.bindListeners=function(){var g=this;this.socket.onopen=function(){g.onOpen()},this.socket.onerror=function(b){g.onError(b)},this.socket.onclose=function(b){g.onClose(b)},this.socket.onmessage=function(b){g.onMessage(b)},this.supportsPing()&&(this.socket.onactivity=function(){g.onActivity()})},p.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},p.prototype.changeState=function(g,b){this.state=g,this.timeline.info(this.buildTimelineMessage({state:g,params:b})),this.emit(g,b)},p.prototype.buildTimelineMessage=function(g){return St({cid:this.id},g)},p}(Sn),$c=jc,Ss=function(){function v(p){this.hooks=p}return v.prototype.isSupported=function(p){return this.hooks.isSupported(p)},v.prototype.createConnection=function(p,g,b,w){return new $c(this.hooks,p,g,b,w)},v}(),Ei=Ss,Ts=new Ei({urls:tr,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!yt.getWebSocketAPI()},isSupported:function(){return!!yt.getWebSocketAPI()},getSocket:function(v){return yt.createWebSocket(v)}}),la={urls:er,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},ca=St({getSocket:function(v){return yt.HTTPFactory.createStreamingSocket(v)}},la),ua=St({getSocket:function(v){return yt.HTTPFactory.createPollingSocket(v)}},la),ha={isSupported:function(){return yt.isXHRSupported()}},Uc=new Ei(St({},ca,ha)),Vc=new Ei(St({},ua,ha)),qc={ws:Ts,xhr_streaming:Uc,xhr_polling:Vc},Hr=qc,fa=new Ei({file:"sockjs",urls:Fr,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(v,p){return new window.SockJS(v,null,{js_path:y.getPath("sockjs",{useTLS:p.useTLS}),ignore_null_origin:p.ignoreNullOrigin})},beforeOpen:function(v,p){v.send(JSON.stringify({path:p}))}}),da={isSupported:function(v){var p=yt.isXDRSupported(v.useTLS);return p}},Xc=new Ei(St({},ca,da)),Yc=new Ei(St({},ua,da));Hr.xdr_streaming=Xc,Hr.xdr_polling=Yc,Hr.sockjs=fa;var Kc=Hr,Gc=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Jc=function(v){Gc(p,v);function p(){var g=v.call(this)||this,b=g;return window.addEventListener!==void 0&&(window.addEventListener("online",function(){b.emit("online")},!1),window.addEventListener("offline",function(){b.emit("offline")},!1)),g}return p.prototype.isOnline=function(){return window.navigator.onLine===void 0?!0:window.navigator.onLine},p}(Sn),zr=new Jc,Zc=function(){function v(p,g,b){this.manager=p,this.transport=g,this.minPingDelay=b.minPingDelay,this.maxPingDelay=b.maxPingDelay,this.pingDelay=void 0}return v.prototype.createConnection=function(p,g,b,w){var O=this;w=St({},w,{activityTimeout:this.pingDelay});var W=this.transport.createConnection(p,g,b,w),Y=null,rt=function(){W.unbind("open",rt),W.bind("closed",nt),Y=Ot.now()},nt=function(ut){if(W.unbind("closed",nt),ut.code===1002||ut.code===1003)O.manager.reportDeath();else if(!ut.wasClean&&Y){var ee=Ot.now()-Y;ee<2*O.maxPingDelay&&(O.manager.reportDeath(),O.pingDelay=Math.max(ee/2,O.minPingDelay))}};return W.bind("open",rt),W},v.prototype.isSupported=function(p){return this.manager.isAlive()&&this.transport.isSupported(p)},v}(),Wr=Zc,pa={decodeMessage:function(v){try{var p=JSON.parse(v.data),g=p.data;if(typeof g=="string")try{g=JSON.parse(p.data)}catch{}var b={event:p.event,channel:p.channel,data:g};return p.user_id&&(b.user_id=p.user_id),b}catch(w){throw{type:"MessageParseError",error:w,data:v.data}}},encodeMessage:function(v){return JSON.stringify(v)},processHandshake:function(v){var p=pa.decodeMessage(v);if(p.event==="pusher:connection_established"){if(!p.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:p.data.socket_id,activityTimeout:p.data.activity_timeout*1e3}}else{if(p.event==="pusher:error")return{action:this.getCloseAction(p.data),error:this.getCloseError(p.data)};throw"Invalid handshake"}},getCloseAction:function(v){return v.code<4e3?v.code>=1002&&v.code<=1004?"backoff":null:v.code===4e3?"tls_only":v.code<4100?"refused":v.code<4200?"backoff":v.code<4300?"retry":"refused"},getCloseError:function(v){return v.code!==1e3&&v.code!==1001?{type:"PusherError",data:{code:v.code,message:v.reason||v.message}}:null}},oi=pa,Qc=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),ga=function(v){Qc(p,v);function p(g,b){var w=v.call(this)||this;return w.id=g,w.transport=b,w.activityTimeout=b.activityTimeout,w.bindListeners(),w}return p.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},p.prototype.send=function(g){return this.transport.send(g)},p.prototype.send_event=function(g,b,w){var O={event:g,data:b};return w&&(O.channel=w),Z.debug("Event sent",O),this.send(oi.encodeMessage(O))},p.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},p.prototype.close=function(){this.transport.close()},p.prototype.bindListeners=function(){var g=this,b={message:function(O){var W;try{W=oi.decodeMessage(O)}catch(Y){g.emit("error",{type:"MessageParseError",error:Y,data:O.data})}if(W!==void 0){switch(Z.debug("Event recd",W),W.event){case"pusher:error":g.emit("error",{type:"PusherError",data:W.data});break;case"pusher:ping":g.emit("ping");break;case"pusher:pong":g.emit("pong");break}g.emit("message",W)}},activity:function(){g.emit("activity")},error:function(O){g.emit("error",O)},closed:function(O){w(),O&&O.code&&g.handleCloseEvent(O),g.transport=null,g.emit("closed")}},w=function(){te(b,function(O,W){g.transport.unbind(W,O)})};te(b,function(O,W){g.transport.bind(W,O)})},p.prototype.handleCloseEvent=function(g){var b=oi.getCloseAction(g),w=oi.getCloseError(g);w&&this.emit("error",w),b&&this.emit(b,{action:b,error:w})},p}(Sn),ma=ga,va=function(){function v(p,g){this.transport=p,this.callback=g,this.bindListeners()}return v.prototype.close=function(){this.unbindListeners(),this.transport.close()},v.prototype.bindListeners=function(){var p=this;this.onMessage=function(g){p.unbindListeners();var b;try{b=oi.processHandshake(g)}catch(w){p.finish("error",{error:w}),p.transport.close();return}b.action==="connected"?p.finish("connected",{connection:new ma(b.id,p.transport),activityTimeout:b.activityTimeout}):(p.finish(b.action,{error:b.error}),p.transport.close())},this.onClosed=function(g){p.unbindListeners();var b=oi.getCloseAction(g)||"backoff",w=oi.getCloseError(g);p.finish(b,{error:w})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},v.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},v.prototype.finish=function(p,g){this.callback(St({transport:this.transport,action:p},g))},v}(),tu=va,eu=function(){function v(p,g){this.timeline=p,this.options=g||{}}return v.prototype.send=function(p,g){this.timeline.isEmpty()||this.timeline.send(yt.TimelineTransport.getAgent(this,p),g)},v}(),nu=eu,iu=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),ba=function(v){iu(p,v);function p(g,b){var w=v.call(this,function(O,W){Z.debug("No callbacks on "+g+" for "+O)})||this;return w.name=g,w.pusher=b,w.subscribed=!1,w.subscriptionPending=!1,w.subscriptionCancelled=!1,w}return p.prototype.authorize=function(g,b){return b(null,{auth:""})},p.prototype.trigger=function(g,b){if(g.indexOf("client-")!==0)throw new M("Event '"+g+"' does not start with 'client-'");if(!this.subscribed){var w=C.buildLogSuffix("triggeringClientEvents");Z.warn("Client event triggered before channel 'subscription_succeeded' event . "+w)}return this.pusher.send_event(g,b,this.name)},p.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},p.prototype.handleEvent=function(g){var b=g.event,w=g.data;if(b==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(g);else if(b==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(g);else if(b.indexOf("pusher_internal:")!==0){var O={};this.emit(b,w,O)}},p.prototype.handleSubscriptionSucceededEvent=function(g){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",g.data)},p.prototype.handleSubscriptionCountEvent=function(g){g.data.subscription_count&&(this.subscriptionCount=g.data.subscription_count),this.emit("pusher:subscription_count",g.data)},p.prototype.subscribe=function(){var g=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(b,w){b?(g.subscriptionPending=!1,Z.error(b.toString()),g.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:b.message},b instanceof F?{status:b.status}:{}))):g.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:g.name})}))},p.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},p.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},p.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},p}(Sn),jr=ba,ya=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Cs=function(v){ya(p,v);function p(){return v!==null&&v.apply(this,arguments)||this}return p.prototype.authorize=function(g,b){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:g},b)},p}(jr),Os=Cs,_a=function(){function v(){this.reset()}return v.prototype.get=function(p){return Object.prototype.hasOwnProperty.call(this.members,p)?{id:p,info:this.members[p]}:null},v.prototype.each=function(p){var g=this;te(this.members,function(b,w){p(g.get(w))})},v.prototype.setMyID=function(p){this.myID=p},v.prototype.onSubscription=function(p){this.members=p.presence.hash,this.count=p.presence.count,this.me=this.get(this.myID)},v.prototype.addMember=function(p){return this.get(p.user_id)===null&&this.count++,this.members[p.user_id]=p.user_info,this.get(p.user_id)},v.prototype.removeMember=function(p){var g=this.get(p.user_id);return g&&(delete this.members[p.user_id],this.count--),g},v.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},v}(),$r=_a,wa=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),ru=function(v,p,g,b){function w(O){return O instanceof g?O:new g(function(W){W(O)})}return new(g||(g=Promise))(function(O,W){function Y(ut){try{nt(b.next(ut))}catch(ee){W(ee)}}function rt(ut){try{nt(b.throw(ut))}catch(ee){W(ee)}}function nt(ut){ut.done?O(ut.value):w(ut.value).then(Y,rt)}nt((b=b.apply(v,p||[])).next())})},xa=function(v,p){var g={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},b,w,O,W;return W={next:Y(0),throw:Y(1),return:Y(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function Y(nt){return function(ut){return rt([nt,ut])}}function rt(nt){if(b)throw new TypeError("Generator is already executing.");for(;g;)try{if(b=1,w&&(O=nt[0]&2?w.return:nt[0]?w.throw||((O=w.return)&&O.call(w),0):w.next)&&!(O=O.call(w,nt[1])).done)return O;switch(w=0,O&&(nt=[nt[0]&2,O.value]),nt[0]){case 0:case 1:O=nt;break;case 4:return g.label++,{value:nt[1],done:!1};case 5:g.label++,w=nt[1],nt=[0];continue;case 7:nt=g.ops.pop(),g.trys.pop();continue;default:if(O=g.trys,!(O=O.length>0&&O[O.length-1])&&(nt[0]===6||nt[0]===2)){g=0;continue}if(nt[0]===3&&(!O||nt[1]>O[0]&&nt[1]<O[3])){g.label=nt[1];break}if(nt[0]===6&&g.label<O[1]){g.label=O[1],O=nt;break}if(O&&g.label<O[2]){g.label=O[2],g.ops.push(nt);break}O[2]&&g.ops.pop(),g.trys.pop();continue}nt=p.call(v,g)}catch(ut){nt=[6,ut],w=0}finally{b=O=0}if(nt[0]&5)throw nt[1];return{value:nt[0]?nt[1]:void 0,done:!0}}},Sa=function(v){wa(p,v);function p(g,b){var w=v.call(this,g,b)||this;return w.members=new $r,w}return p.prototype.authorize=function(g,b){var w=this;v.prototype.authorize.call(this,g,function(O,W){return ru(w,void 0,void 0,function(){var Y,rt;return xa(this,function(nt){switch(nt.label){case 0:return O?[3,3]:(W=W,W.channel_data==null?[3,1]:(Y=JSON.parse(W.channel_data),this.members.setMyID(Y.user_id),[3,3]));case 1:return[4,this.pusher.user.signinDonePromise];case 2:if(nt.sent(),this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else return rt=C.buildLogSuffix("authorizationEndpoint"),Z.error("Invalid auth response for channel '"+this.name+"', "+("expected 'channel_data' field. "+rt+", ")+"or the user should be signed in."),b("Invalid auth response"),[2];nt.label=3;case 3:return b(O,W),[2]}})})})},p.prototype.handleEvent=function(g){var b=g.event;if(b.indexOf("pusher_internal:")===0)this.handleInternalEvent(g);else{var w=g.data,O={};g.user_id&&(O.user_id=g.user_id),this.emit(b,w,O)}},p.prototype.handleInternalEvent=function(g){var b=g.event,w=g.data;switch(b){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(g);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(g);break;case"pusher_internal:member_added":var O=this.members.addMember(w);this.emit("pusher:member_added",O);break;case"pusher_internal:member_removed":var W=this.members.removeMember(w);W&&this.emit("pusher:member_removed",W);break}},p.prototype.handleSubscriptionSucceededEvent=function(g){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(g.data),this.emit("pusher:subscription_succeeded",this.members))},p.prototype.disconnect=function(){this.members.reset(),v.prototype.disconnect.call(this)},p}(Os),ks=Sa,su=r(1),Ur=r(0),As=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Es=function(v){As(p,v);function p(g,b,w){var O=v.call(this,g,b)||this;return O.key=null,O.nacl=w,O}return p.prototype.authorize=function(g,b){var w=this;v.prototype.authorize.call(this,g,function(O,W){if(O){b(O,W);return}var Y=W.shared_secret;if(!Y){b(new Error("No shared_secret key in auth payload for encrypted channel: "+w.name),null);return}w.key=Object(Ur.decode)(Y),delete W.shared_secret,b(null,W)})},p.prototype.trigger=function(g,b){throw new I("Client events are not currently supported for encrypted channels")},p.prototype.handleEvent=function(g){var b=g.event,w=g.data;if(b.indexOf("pusher_internal:")===0||b.indexOf("pusher:")===0){v.prototype.handleEvent.call(this,g);return}this.handleEncryptedEvent(b,w)},p.prototype.handleEncryptedEvent=function(g,b){var w=this;if(!this.key){Z.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!b.ciphertext||!b.nonce){Z.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+b);return}var O=Object(Ur.decode)(b.ciphertext);if(O.length<this.nacl.secretbox.overheadLength){Z.error("Expected encrypted event ciphertext length to be "+this.nacl.secretbox.overheadLength+", got: "+O.length);return}var W=Object(Ur.decode)(b.nonce);if(W.length<this.nacl.secretbox.nonceLength){Z.error("Expected encrypted event nonce length to be "+this.nacl.secretbox.nonceLength+", got: "+W.length);return}var Y=this.nacl.secretbox.open(O,W,this.key);if(Y===null){Z.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,function(rt,nt){if(rt){Z.error("Failed to make a request to the authEndpoint: "+nt+". Unable to fetch new key, so dropping encrypted event");return}if(Y=w.nacl.secretbox.open(O,W,w.key),Y===null){Z.error("Failed to decrypt event with new key. Dropping encrypted event");return}w.emit(g,w.getDataToEmit(Y))});return}this.emit(g,this.getDataToEmit(Y))},p.prototype.getDataToEmit=function(g){var b=Object(su.decode)(g);try{return JSON.parse(b)}catch{return b}},p}(Os),Pi=Es,Ta=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Ca=function(v){Ta(p,v);function p(g,b){var w=v.call(this)||this;w.state="initialized",w.connection=null,w.key=g,w.options=b,w.timeline=w.options.timeline,w.usingTLS=w.options.useTLS,w.errorCallbacks=w.buildErrorCallbacks(),w.connectionCallbacks=w.buildConnectionCallbacks(w.errorCallbacks),w.handshakeCallbacks=w.buildHandshakeCallbacks(w.errorCallbacks);var O=yt.getNetwork();return O.bind("online",function(){w.timeline.info({netinfo:"online"}),(w.state==="connecting"||w.state==="unavailable")&&w.retryIn(0)}),O.bind("offline",function(){w.timeline.info({netinfo:"offline"}),w.connection&&w.sendActivityCheck()}),w.updateStrategy(),w}return p.prototype.connect=function(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}},p.prototype.send=function(g){return this.connection?this.connection.send(g):!1},p.prototype.send_event=function(g,b,w){return this.connection?this.connection.send_event(g,b,w):!1},p.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},p.prototype.isUsingTLS=function(){return this.usingTLS},p.prototype.startConnecting=function(){var g=this,b=function(w,O){w?g.runner=g.strategy.connect(0,b):O.action==="error"?(g.emit("error",{type:"HandshakeError",error:O.error}),g.timeline.error({handshakeError:O.error})):(g.abortConnecting(),g.handshakeCallbacks[O.action](O))};this.runner=this.strategy.connect(0,b)},p.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},p.prototype.disconnectInternally=function(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var g=this.abandonConnection();g.close()}},p.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},p.prototype.retryIn=function(g){var b=this;this.timeline.info({action:"retry",delay:g}),g>0&&this.emit("connecting_in",Math.round(g/1e3)),this.retryTimer=new Ct(g||0,function(){b.disconnectInternally(),b.connect()})},p.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},p.prototype.setUnavailableTimer=function(){var g=this;this.unavailableTimer=new Ct(this.options.unavailableTimeout,function(){g.updateState("unavailable")})},p.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},p.prototype.sendActivityCheck=function(){var g=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ct(this.options.pongTimeout,function(){g.timeline.error({pong_timed_out:g.options.pongTimeout}),g.retryIn(0)})},p.prototype.resetActivityCheck=function(){var g=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ct(this.activityTimeout,function(){g.sendActivityCheck()}))},p.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},p.prototype.buildConnectionCallbacks=function(g){var b=this;return St({},g,{message:function(w){b.resetActivityCheck(),b.emit("message",w)},ping:function(){b.send_event("pusher:pong",{})},activity:function(){b.resetActivityCheck()},error:function(w){b.emit("error",w)},closed:function(){b.abandonConnection(),b.shouldRetry()&&b.retryIn(1e3)}})},p.prototype.buildHandshakeCallbacks=function(g){var b=this;return St({},g,{connected:function(w){b.activityTimeout=Math.min(b.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),b.clearUnavailableTimer(),b.setConnection(w.connection),b.socket_id=b.connection.id,b.updateState("connected",{socket_id:b.socket_id})}})},p.prototype.buildErrorCallbacks=function(){var g=this,b=function(w){return function(O){O.error&&g.emit("error",{type:"WebSocketError",error:O.error}),w(O)}};return{tls_only:b(function(){g.usingTLS=!0,g.updateStrategy(),g.retryIn(0)}),refused:b(function(){g.disconnect()}),backoff:b(function(){g.retryIn(1e3)}),retry:b(function(){g.retryIn(0)})}},p.prototype.setConnection=function(g){this.connection=g;for(var b in this.connectionCallbacks)this.connection.bind(b,this.connectionCallbacks[b]);this.resetActivityCheck()},p.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var g in this.connectionCallbacks)this.connection.unbind(g,this.connectionCallbacks[g]);var b=this.connection;return this.connection=null,b}},p.prototype.updateState=function(g,b){var w=this.state;if(this.state=g,w!==g){var O=g;O==="connected"&&(O+=" with new socket ID "+b.socket_id),Z.debug("State changed",w+" -> "+O),this.timeline.info({state:g,params:b}),this.emit("state_change",{previous:w,current:g}),this.emit(g,b)}},p.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},p}(Sn),ou=Ca,Oa=function(){function v(){this.channels={}}return v.prototype.add=function(p,g){return this.channels[p]||(this.channels[p]=Aa(p,g)),this.channels[p]},v.prototype.all=function(){return re(this.channels)},v.prototype.find=function(p){return this.channels[p]},v.prototype.remove=function(p){var g=this.channels[p];return delete this.channels[p],g},v.prototype.disconnect=function(){te(this.channels,function(p){p.disconnect()})},v}(),ka=Oa;function Aa(v,p){if(v.indexOf("private-encrypted-")===0){if(p.config.nacl)return Fn.createEncryptedChannel(v,p,p.config.nacl);var g="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",b=C.buildLogSuffix("encryptedChannelSupport");throw new I(g+". "+b)}else{if(v.indexOf("private-")===0)return Fn.createPrivateChannel(v,p);if(v.indexOf("presence-")===0)return Fn.createPresenceChannel(v,p);if(v.indexOf("#")===0)throw new B('Cannot create a channel with name "'+v+'".');return Fn.createChannel(v,p)}}var Ea={createChannels:function(){return new ka},createConnectionManager:function(v,p){return new ou(v,p)},createChannel:function(v,p){return new jr(v,p)},createPrivateChannel:function(v,p){return new Os(v,p)},createPresenceChannel:function(v,p){return new ks(v,p)},createEncryptedChannel:function(v,p,g){return new Pi(v,p,g)},createTimelineSender:function(v,p){return new nu(v,p)},createHandshake:function(v,p){return new tu(v,p)},createAssistantToTheTransportManager:function(v,p,g){return new Wr(v,p,g)}},Fn=Ea,au=function(){function v(p){this.options=p||{},this.livesLeft=this.options.lives||1/0}return v.prototype.getAssistant=function(p){return Fn.createAssistantToTheTransportManager(this,p,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},v.prototype.isAlive=function(){return this.livesLeft>0},v.prototype.reportDeath=function(){this.livesLeft-=1},v}(),Pa=au,Ma=function(){function v(p,g){this.strategies=p,this.loop=!!g.loop,this.failFast=!!g.failFast,this.timeout=g.timeout,this.timeoutLimit=g.timeoutLimit}return v.prototype.isSupported=function(){return Xt(this.strategies,Ot.method("isSupported"))},v.prototype.connect=function(p,g){var b=this,w=this.strategies,O=0,W=this.timeout,Y=null,rt=function(nt,ut){ut?g(null,ut):(O=O+1,b.loop&&(O=O%w.length),O<w.length?(W&&(W=W*2,b.timeoutLimit&&(W=Math.min(W,b.timeoutLimit))),Y=b.tryStrategy(w[O],p,{timeout:W,failFast:b.failFast},rt)):g(!0))};return Y=this.tryStrategy(w[O],p,{timeout:W,failFast:this.failFast},rt),{abort:function(){Y.abort()},forceMinPriority:function(nt){p=nt,Y&&Y.forceMinPriority(nt)}}},v.prototype.tryStrategy=function(p,g,b,w){var O=null,W=null;return b.timeout>0&&(O=new Ct(b.timeout,function(){W.abort(),w(!0)})),W=p.connect(g,function(Y,rt){Y&&O&&O.isRunning()&&!b.failFast||(O&&O.ensureAborted(),w(Y,rt))}),{abort:function(){O&&O.ensureAborted(),W.abort()},forceMinPriority:function(Y){W.forceMinPriority(Y)}}},v}(),ai=Ma,lu=function(){function v(p){this.strategies=p}return v.prototype.isSupported=function(){return Xt(this.strategies,Ot.method("isSupported"))},v.prototype.connect=function(p,g){return cu(this.strategies,p,function(b,w){return function(O,W){if(w[b].error=O,O){Ms(w)&&g(!0);return}oe(w,function(Y){Y.forceMinPriority(W.transport.priority)}),g(null,W)}})},v}(),Ps=lu;function cu(v,p,g){var b=we(v,function(w,O,W,Y){return w.connect(p,g(O,Y))});return{abort:function(){oe(b,uu)},forceMinPriority:function(w){oe(b,function(O){O.forceMinPriority(w)})}}}function Ms(v){return xe(v,function(p){return!!p.error})}function uu(v){!v.error&&!v.aborted&&(v.abort(),v.aborted=!0)}var hu=function(){function v(p,g,b){this.strategy=p,this.transports=g,this.ttl=b.ttl||1800*1e3,this.usingTLS=b.useTLS,this.timeline=b.timeline}return v.prototype.isSupported=function(){return this.strategy.isSupported()},v.prototype.connect=function(p,g){var b=this.usingTLS,w=du(b),O=[this.strategy];if(w&&w.timestamp+this.ttl>=Ot.now()){var W=this.transports[w.transport];W&&(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),O.push(new ai([W],{timeout:w.latency*2+1e3,failFast:!0})))}var Y=Ot.now(),rt=O.pop().connect(p,function nt(ut,ee){ut?(Ut(b),O.length>0?(Y=Ot.now(),rt=O.pop().connect(p,nt)):g(ut)):(qt(b,ee.transport.name,Ot.now()-Y),g(null,ee))});return{abort:function(){rt.abort()},forceMinPriority:function(nt){p=nt,rt&&rt.forceMinPriority(nt)}}},v}(),fu=hu;function Rs(v){return"pusherTransport"+(v?"TLS":"NonTLS")}function du(v){var p=yt.getLocalStorage();if(p)try{var g=p[Rs(v)];if(g)return JSON.parse(g)}catch{Ut(v)}return null}function qt(v,p,g){var b=yt.getLocalStorage();if(b)try{b[Rs(v)]=Se({timestamp:Ot.now(),transport:p,latency:g})}catch{}}function Ut(v){var p=yt.getLocalStorage();if(p)try{delete p[Rs(v)]}catch{}}var pu=function(){function v(p,g){var b=g.delay;this.strategy=p,this.options={delay:b}}return v.prototype.isSupported=function(){return this.strategy.isSupported()},v.prototype.connect=function(p,g){var b=this.strategy,w,O=new Ct(this.options.delay,function(){w=b.connect(p,g)});return{abort:function(){O.ensureAborted(),w&&w.abort()},forceMinPriority:function(W){p=W,w&&w.forceMinPriority(W)}}},v}(),Vr=pu,gu=function(){function v(p,g,b){this.test=p,this.trueBranch=g,this.falseBranch=b}return v.prototype.isSupported=function(){var p=this.test()?this.trueBranch:this.falseBranch;return p.isSupported()},v.prototype.connect=function(p,g){var b=this.test()?this.trueBranch:this.falseBranch;return b.connect(p,g)},v}(),nr=gu,mu=function(){function v(p){this.strategy=p}return v.prototype.isSupported=function(){return this.strategy.isSupported()},v.prototype.connect=function(p,g){var b=this.strategy.connect(p,function(w,O){O&&b.abort(),g(w,O)});return b},v}(),vu=mu;function Mi(v){return function(){return v.isSupported()}}var bu=function(v,p,g){var b={};function w(ar,Gn,Jr,Ka,Zr){var Gs=g(v,ar,Gn,Jr,Ka,Zr);return b[ar]=Gs,Gs}var O=Object.assign({},p,{hostNonTLS:v.wsHost+":"+v.wsPort,hostTLS:v.wsHost+":"+v.wssPort,httpPath:v.wsPath}),W=Object.assign({},O,{useTLS:!0}),Y=Object.assign({},p,{hostNonTLS:v.httpHost+":"+v.httpPort,hostTLS:v.httpHost+":"+v.httpsPort,httpPath:v.httpPath}),rt={loop:!0,timeout:15e3,timeoutLimit:6e4},nt=new Pa({lives:2,minPingDelay:1e4,maxPingDelay:v.activityTimeout}),ut=new Pa({lives:2,minPingDelay:1e4,maxPingDelay:v.activityTimeout}),ee=w("ws","ws",3,O,nt),Tn=w("wss","ws",3,W,nt),tn=w("sockjs","sockjs",1,Y),rr=w("xhr_streaming","xhr_streaming",1,Y,ut),Iu=w("xdr_streaming","xdr_streaming",1,Y,ut),ci=w("xhr_polling","xhr_polling",1,Y),Gr=w("xdr_polling","xdr_polling",1,Y),sr=new ai([ee],rt),Ht=new ai([Tn],rt),Nu=new ai([tn],rt),Xs=new ai([new nr(Mi(rr),rr,Iu)],rt),or=new ai([new nr(Mi(ci),ci,Gr)],rt),Ya=new ai([new nr(Mi(Xs),new Ps([Xs,new Vr(or,{delay:4e3})]),or)],rt),Ys=new nr(Mi(Ya),Ya,Nu),Ks;return p.useTLS?Ks=new Ps([sr,new Vr(Ys,{delay:2e3})]):Ks=new Ps([sr,new Vr(Ht,{delay:2e3}),new Vr(Ys,{delay:5e3})]),new fu(new vu(new nr(Mi(ee),Ks,Ys)),b,{ttl:18e5,timeline:p.timeline,useTLS:p.useTLS})},Te=bu,Ds=function(){var v=this;v.timeline.info(v.buildTimelineMessage({transport:v.name+(v.options.useTLS?"s":"")})),v.hooks.isInitialized()?v.changeState("initialized"):v.hooks.file?(v.changeState("initializing"),y.load(v.hooks.file,{useTLS:v.options.useTLS},function(p,g){v.hooks.isInitialized()?(v.changeState("initialized"),g(!0)):(p&&v.onError(p),v.onClose(),g(!1))})):v.onClose()},li={getRequest:function(v){var p=new window.XDomainRequest;return p.ontimeout=function(){v.emit("error",new D),v.close()},p.onerror=function(g){v.emit("error",g),v.close()},p.onprogress=function(){p.responseText&&p.responseText.length>0&&v.onChunk(200,p.responseText)},p.onload=function(){p.responseText&&p.responseText.length>0&&v.onChunk(200,p.responseText),v.emit("finished",200),v.close()},p},abortRequest:function(v){v.ontimeout=v.onerror=v.onprogress=v.onload=null,v.abort()}},Ra=li,Ls=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Qe=256*1024,Da=function(v){Ls(p,v);function p(g,b,w){var O=v.call(this)||this;return O.hooks=g,O.method=b,O.url=w,O}return p.prototype.start=function(g){var b=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){b.close()},yt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(g)},p.prototype.close=function(){this.unloader&&(yt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},p.prototype.onChunk=function(g,b){for(;;){var w=this.advanceBuffer(b);if(w)this.emit("chunk",{status:g,data:w});else break}this.isBufferTooLong(b)&&this.emit("buffer_too_long")},p.prototype.advanceBuffer=function(g){var b=g.slice(this.position),w=b.indexOf(`
`);return w!==-1?(this.position+=w+1,b.slice(0,w)):null},p.prototype.isBufferTooLong=function(g){return this.position===g.length&&g.length>Qe},p}(Sn),La=Da,qr;(function(v){v[v.CONNECTING=0]="CONNECTING",v[v.OPEN=1]="OPEN",v[v.CLOSED=3]="CLOSED"})(qr||(qr={}));var Vn=qr,Ia=1,Na=function(){function v(p,g){this.hooks=p,this.session=Is(1e3)+"/"+qn(8),this.location=Xe(g),this.readyState=Vn.CONNECTING,this.openStream()}return v.prototype.send=function(p){return this.sendRaw(JSON.stringify([p]))},v.prototype.ping=function(){this.hooks.sendHeartbeat(this)},v.prototype.close=function(p,g){this.onClose(p,g,!0)},v.prototype.sendRaw=function(p){if(this.readyState===Vn.OPEN)try{return yt.createSocketRequest("POST",Ye(yu(this.location,this.session))).start(p),!0}catch{return!1}else return!1},v.prototype.reconnect=function(){this.closeStream(),this.openStream()},v.prototype.onClose=function(p,g,b){this.closeStream(),this.readyState=Vn.CLOSED,this.onclose&&this.onclose({code:p,reason:g,wasClean:b})},v.prototype.onChunk=function(p){if(p.status===200){this.readyState===Vn.OPEN&&this.onActivity();var g,b=p.data.slice(0,1);switch(b){case"o":g=JSON.parse(p.data.slice(1)||"{}"),this.onOpen(g);break;case"a":g=JSON.parse(p.data.slice(1)||"[]");for(var w=0;w<g.length;w++)this.onEvent(g[w]);break;case"m":g=JSON.parse(p.data.slice(1)||"null"),this.onEvent(g);break;case"h":this.hooks.onHeartbeat(this);break;case"c":g=JSON.parse(p.data.slice(1)||"[]"),this.onClose(g[0],g[1],!0);break}}},v.prototype.onOpen=function(p){this.readyState===Vn.CONNECTING?(p&&p.hostname&&(this.location.base=_u(this.location.base,p.hostname)),this.readyState=Vn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},v.prototype.onEvent=function(p){this.readyState===Vn.OPEN&&this.onmessage&&this.onmessage({data:p})},v.prototype.onActivity=function(){this.onactivity&&this.onactivity()},v.prototype.onError=function(p){this.onerror&&this.onerror(p)},v.prototype.openStream=function(){var p=this;this.stream=yt.createSocketRequest("POST",Ye(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",function(g){p.onChunk(g)}),this.stream.bind("finished",function(g){p.hooks.onFinished(p,g)}),this.stream.bind("buffer_too_long",function(){p.reconnect()});try{this.stream.start()}catch(g){Ot.defer(function(){p.onError(g),p.onClose(1006,"Could not start streaming",!1)})}},v.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},v}();function Xe(v){var p=/([^\?]*)\/*(\??.*)/.exec(v);return{base:p[1],queryString:p[2]}}function yu(v,p){return v.base+"/"+p+"/xhr_send"}function Ye(v){var p=v.indexOf("?")===-1?"?":"&";return v+p+"t="+ +new Date+"&n="+Ia++}function _u(v,p){var g=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(v);return g[1]+p+g[3]}function Is(v){return yt.randomInt(v)}function qn(v){for(var p=[],g=0;g<v;g++)p.push(Is(32).toString(32));return p.join("")}var Xr=Na,Ns={getReceiveURL:function(v,p){return v.base+"/"+p+"/xhr_streaming"+v.queryString},onHeartbeat:function(v){v.sendRaw("[]")},sendHeartbeat:function(v){v.sendRaw("[]")},onFinished:function(v,p){v.onClose(1006,"Connection interrupted ("+p+")",!1)}},Kt=Ns,Xn={getReceiveURL:function(v,p){return v.base+"/"+p+"/xhr"+v.queryString},onHeartbeat:function(){},sendHeartbeat:function(v){v.sendRaw("[]")},onFinished:function(v,p){p===200?v.reconnect():v.onClose(1006,"Connection interrupted ("+p+")",!1)}},Fs=Xn,wu={getRequest:function(v){var p=yt.getXHRAPI(),g=new p;return g.onreadystatechange=g.onprogress=function(){switch(g.readyState){case 3:g.responseText&&g.responseText.length>0&&v.onChunk(g.status,g.responseText);break;case 4:g.responseText&&g.responseText.length>0&&v.onChunk(g.status,g.responseText),v.emit("finished",g.status),v.close();break}},g},abortRequest:function(v){v.onreadystatechange=null,v.abort()}},Bs=wu,xu={createStreamingSocket:function(v){return this.createSocket(Kt,v)},createPollingSocket:function(v){return this.createSocket(Fs,v)},createSocket:function(v,p){return new Xr(v,p)},createXHR:function(v,p){return this.createRequest(Bs,v,p)},createRequest:function(v,p,g){return new La(v,p,g)}},Fa=xu;Fa.createXDR=function(v,p){return this.createRequest(Ra,v,p)};var Su=Fa,Ba={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:m,getDefaultStrategy:Te,Transports:Kc,transportConnectionInitializer:Ds,HTTPFactory:Su,TimelineTransport:Ne,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(v){var p=this;window.Pusher=v;var g=function(){p.onDocumentBody(v.ready)};window.JSON?g():y.load("json2",{},g)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:ht}},onDocumentBody:function(v){var p=this;document.body?v():setTimeout(function(){p.onDocumentBody(v)},0)},createJSONPRequest:function(v,p){return new de(v,p)},createScriptRequest:function(v){return new Bt(v)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var v=this.getXHRAPI();return new v},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return zr},createWebSocket:function(v){var p=this.getWebSocketAPI();return new p(v)},createSocketRequest:function(v,p){if(this.isXHRSupported())return this.HTTPFactory.createXHR(v,p);if(this.isXDRSupported(p.indexOf("https:")===0))return this.HTTPFactory.createXDR(v,p);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var v=this.getXHRAPI();return!!v&&new v().withCredentials!==void 0},isXDRSupported:function(v){var p=v?"https:":"http:",g=this.getProtocol();return!!window.XDomainRequest&&g===p},addUnloadListener:function(v){window.addEventListener!==void 0?window.addEventListener("unload",v,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",v)},removeUnloadListener:function(v){window.addEventListener!==void 0?window.removeEventListener("unload",v,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",v)},randomInt:function(v){var p=function(){var g=window.crypto||window.msCrypto,b=g.getRandomValues(new Uint32Array(1))[0];return b/Math.pow(2,32)};return Math.floor(p()*v)}},yt=Ba,Yn;(function(v){v[v.ERROR=3]="ERROR",v[v.INFO=6]="INFO",v[v.DEBUG=7]="DEBUG"})(Yn||(Yn={}));var Yr=Yn,Ha=function(){function v(p,g,b){this.key=p,this.session=g,this.events=[],this.options=b||{},this.sent=0,this.uniqueID=0}return v.prototype.log=function(p,g){p<=this.options.level&&(this.events.push(St({},g,{timestamp:Ot.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},v.prototype.error=function(p){this.log(Yr.ERROR,p)},v.prototype.info=function(p){this.log(Yr.INFO,p)},v.prototype.debug=function(p){this.log(Yr.DEBUG,p)},v.prototype.isEmpty=function(){return this.events.length===0},v.prototype.send=function(p,g){var b=this,w=St({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],p(w,function(O,W){O||b.sent++,g&&g(O,W)}),!0},v.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},v}(),za=Ha,Hs=function(){function v(p,g,b,w){this.name=p,this.priority=g,this.transport=b,this.options=w||{}}return v.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},v.prototype.connect=function(p,g){var b=this;if(this.isSupported()){if(this.priority<p)return Ws(new R,g)}else return Ws(new q,g);var w=!1,O=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),W=null,Y=function(){O.unbind("initialized",Y),O.connect()},rt=function(){W=Fn.createHandshake(O,function(Tn){w=!0,ee(),g(null,Tn)})},nt=function(Tn){ee(),g(Tn)},ut=function(){ee();var Tn;Tn=Se(O),g(new N(Tn))},ee=function(){O.unbind("initialized",Y),O.unbind("open",rt),O.unbind("error",nt),O.unbind("closed",ut)};return O.bind("initialized",Y),O.bind("open",rt),O.bind("error",nt),O.bind("closed",ut),O.initialize(),{abort:function(){w||(ee(),W?W.close():O.close())},forceMinPriority:function(Tn){w||b.priority<Tn&&(W?W.close():O.close())}}},v}(),zs=Hs;function Ws(v,p){return Ot.defer(function(){p(v)}),{abort:function(){},forceMinPriority:function(){}}}var Tu=yt.Transports,js=function(v,p,g,b,w,O){var W=Tu[g];if(!W)throw new j(g);var Y=(!v.enabledTransports||De(v.enabledTransports,p)!==-1)&&(!v.disabledTransports||De(v.disabledTransports,p)===-1),rt;return Y?(w=Object.assign({ignoreNullOrigin:v.ignoreNullOrigin},w),rt=new zs(p,b,O?O.getAssistant(W):W,w)):rt=$s,rt},$s={isSupported:function(){return!1},connect:function(v,p){var g=Ot.defer(function(){p(new q)});return{abort:function(){g.ensureAborted()},forceMinPriority:function(){}}}},Cu=function(v,p){var g="socket_id="+encodeURIComponent(v.socketId);for(var b in p.params)g+="&"+encodeURIComponent(b)+"="+encodeURIComponent(p.params[b]);if(p.paramsProvider!=null){var w=p.paramsProvider();for(var b in w)g+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return g},Wa=function(v){if(typeof yt.getAuthorizers()[v.transport]>"u")throw"'"+v.transport+"' is not a recognized auth transport";return function(p,g){var b=Cu(p,v);yt.getAuthorizers()[v.transport](yt,b,v,T.UserAuthentication,g)}},Ke=Wa,Us=function(v,p){var g="socket_id="+encodeURIComponent(v.socketId);g+="&channel_name="+encodeURIComponent(v.channelName);for(var b in p.params)g+="&"+encodeURIComponent(b)+"="+encodeURIComponent(p.params[b]);if(p.paramsProvider!=null){var w=p.paramsProvider();for(var b in w)g+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return g},ir=function(v){if(typeof yt.getAuthorizers()[v.transport]>"u")throw"'"+v.transport+"' is not a recognized auth transport";return function(p,g){var b=Us(p,v);yt.getAuthorizers()[v.transport](yt,b,v,T.ChannelAuthorization,g)}},ja=ir,$a=function(v,p,g){var b={authTransport:p.transport,authEndpoint:p.endpoint,auth:{params:p.params,headers:p.headers}};return function(w,O){var W=v.channel(w.channelName),Y=g(W,b);Y.authorize(w.socketId,O)}},Ri=function(){return Ri=Object.assign||function(v){for(var p,g=1,b=arguments.length;g<b;g++){p=arguments[g];for(var w in p)Object.prototype.hasOwnProperty.call(p,w)&&(v[w]=p[w])}return v},Ri.apply(this,arguments)};function Ou(v,p){var g={activityTimeout:v.activityTimeout||u.activityTimeout,cluster:v.cluster||u.cluster,httpPath:v.httpPath||u.httpPath,httpPort:v.httpPort||u.httpPort,httpsPort:v.httpsPort||u.httpsPort,pongTimeout:v.pongTimeout||u.pongTimeout,statsHost:v.statsHost||u.stats_host,unavailableTimeout:v.unavailableTimeout||u.unavailableTimeout,wsPath:v.wsPath||u.wsPath,wsPort:v.wsPort||u.wsPort,wssPort:v.wssPort||u.wssPort,enableStats:Eu(v),httpHost:ku(v),useTLS:Di(v),wsHost:Au(v),userAuthenticator:Pu(v),channelAuthorizer:Va(v,p)};return"disabledTransports"in v&&(g.disabledTransports=v.disabledTransports),"enabledTransports"in v&&(g.enabledTransports=v.enabledTransports),"ignoreNullOrigin"in v&&(g.ignoreNullOrigin=v.ignoreNullOrigin),"timelineParams"in v&&(g.timelineParams=v.timelineParams),"nacl"in v&&(g.nacl=v.nacl),g}function ku(v){return v.httpHost?v.httpHost:v.cluster?"sockjs-"+v.cluster+".pusher.com":u.httpHost}function Au(v){return v.wsHost?v.wsHost:v.cluster?Ua(v.cluster):Ua(u.cluster)}function Ua(v){return"ws-"+v+".pusher.com"}function Di(v){return yt.getProtocol()==="https:"?!0:v.forceTLS!==!1}function Eu(v){return"enableStats"in v?v.enableStats:"disableStats"in v?!v.disableStats:!1}function Pu(v){var p=Ri(Ri({},u.userAuthentication),v.userAuthentication);return"customHandler"in p&&p.customHandler!=null?p.customHandler:Ke(p)}function Vs(v,p){var g;return"channelAuthorization"in v?g=Ri(Ri({},u.channelAuthorization),v.channelAuthorization):(g={transport:v.authTransport||u.authTransport,endpoint:v.authEndpoint||u.authEndpoint},"auth"in v&&("params"in v.auth&&(g.params=v.auth.params),"headers"in v.auth&&(g.headers=v.auth.headers)),"authorizer"in v&&(g.customHandler=$a(p,g,v.authorizer))),g}function Va(v,p){var g=Vs(v,p);return"customHandler"in g&&g.customHandler!=null?g.customHandler:ja(g)}var Kn=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Kr=function(v){Kn(p,v);function p(g){var b=v.call(this,function(w,O){Z.debug("No callbacks on watchlist events for "+w)})||this;return b.pusher=g,b.bindWatchlistInternalEvent(),b}return p.prototype.handleEvent=function(g){var b=this;g.data.events.forEach(function(w){b.emit(w.name,w)})},p.prototype.bindWatchlistInternalEvent=function(){var g=this;this.pusher.connection.bind("message",function(b){var w=b.event;w==="pusher_internal:watchlist_events"&&g.handleEvent(b)})},p}(Sn),Mu=Kr;function Ru(){var v,p,g=new Promise(function(b,w){v=b,p=w});return{promise:g,resolve:v,reject:p}}var Du=Ru,Li=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),pn=function(v){Li(p,v);function p(g){var b=v.call(this,function(w,O){Z.debug("No callbacks on user for "+w)})||this;return b.signin_requested=!1,b.user_data=null,b.serverToUserChannel=null,b.signinDonePromise=null,b._signinDoneResolve=null,b._onAuthorize=function(w,O){if(w){Z.warn("Error during signin: "+w),b._cleanup();return}b.pusher.send_event("pusher:signin",{auth:O.auth,user_data:O.user_data})},b.pusher=g,b.pusher.connection.bind("state_change",function(w){var O=w.previous,W=w.current;O!=="connected"&&W==="connected"&&b._signin(),O==="connected"&&W!=="connected"&&(b._cleanup(),b._newSigninPromiseIfNeeded())}),b.watchlist=new Mu(g),b.pusher.connection.bind("message",function(w){var O=w.event;O==="pusher:signin_success"&&b._onSigninSuccess(w.data),b.serverToUserChannel&&b.serverToUserChannel.name===w.channel&&b.serverToUserChannel.handleEvent(w)}),b}return p.prototype.signin=function(){this.signin_requested||(this.signin_requested=!0,this._signin())},p.prototype._signin=function(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))},p.prototype._onSigninSuccess=function(g){try{this.user_data=JSON.parse(g.user_data)}catch{Z.error("Failed parsing user data after signin: "+g.user_data),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){Z.error("user_data doesn't contain an id. user_data: "+this.user_data),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()},p.prototype._subscribeChannels=function(){var g=this,b=function(w){w.subscriptionPending&&w.subscriptionCancelled?w.reinstateSubscription():!w.subscriptionPending&&g.pusher.connection.state==="connected"&&w.subscribe()};this.serverToUserChannel=new jr("#server-to-user-"+this.user_data.id,this.pusher),this.serverToUserChannel.bind_global(function(w,O){w.indexOf("pusher_internal:")===0||w.indexOf("pusher:")===0||g.emit(w,O)}),b(this.serverToUserChannel)},p.prototype._cleanup=function(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()},p.prototype._newSigninPromiseIfNeeded=function(){if(this.signin_requested&&!(this.signinDonePromise&&!this.signinDonePromise.done)){var g=Du(),b=g.promise,w=g.resolve;b.done=!1;var O=function(){b.done=!0};b.then(O).catch(O),this.signinDonePromise=b,this._signinDoneResolve=w}},p}(Sn),qa=pn,Xa=function(){function v(p,g){var b=this;if(Lu(p),g=g||{},!g.cluster&&!(g.wsHost||g.httpHost)){var w=C.buildLogSuffix("javascriptQuickStart");Z.warn("You should always specify a cluster when connecting. "+w)}"disableStats"in g&&Z.warn("The disableStats option is deprecated in favor of enableStats"),this.key=p,this.config=Ou(g,this),this.channels=Fn.createChannels(),this.global_emitter=new Sn,this.sessionID=yt.randomInt(1e9),this.timeline=new za(this.key,this.sessionID,{cluster:this.config.cluster,features:v.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Yr.INFO,version:u.VERSION}),this.config.enableStats&&(this.timelineSender=Fn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+yt.TimelineTransport.name}));var O=function(W){return yt.getDefaultStrategy(b.config,W,js)};this.connection=Fn.createConnectionManager(this.key,{getStrategy:O,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",function(){b.subscribeAll(),b.timelineSender&&b.timelineSender.send(b.connection.isUsingTLS())}),this.connection.bind("message",function(W){var Y=W.event,rt=Y.indexOf("pusher_internal:")===0;if(W.channel){var nt=b.channel(W.channel);nt&&nt.handleEvent(W)}rt||b.global_emitter.emit(W.event,W.data)}),this.connection.bind("connecting",function(){b.channels.disconnect()}),this.connection.bind("disconnected",function(){b.channels.disconnect()}),this.connection.bind("error",function(W){Z.warn(W)}),v.instances.push(this),this.timeline.info({instances:v.instances.length}),this.user=new qa(this),v.isReady&&this.connect()}return v.ready=function(){v.isReady=!0;for(var p=0,g=v.instances.length;p<g;p++)v.instances[p].connect()},v.getClientFeatures=function(){return Le(wn({ws:yt.Transports.ws},function(p){return p.isSupported({})}))},v.prototype.channel=function(p){return this.channels.find(p)},v.prototype.allChannels=function(){return this.channels.all()},v.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var p=this.connection.isUsingTLS(),g=this.timelineSender;this.timelineSenderTimer=new Nt(6e4,function(){g.send(p)})}},v.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},v.prototype.bind=function(p,g,b){return this.global_emitter.bind(p,g,b),this},v.prototype.unbind=function(p,g,b){return this.global_emitter.unbind(p,g,b),this},v.prototype.bind_global=function(p){return this.global_emitter.bind_global(p),this},v.prototype.unbind_global=function(p){return this.global_emitter.unbind_global(p),this},v.prototype.unbind_all=function(p){return this.global_emitter.unbind_all(),this},v.prototype.subscribeAll=function(){var p;for(p in this.channels.channels)this.channels.channels.hasOwnProperty(p)&&this.subscribe(p)},v.prototype.subscribe=function(p){var g=this.channels.add(p,this);return g.subscriptionPending&&g.subscriptionCancelled?g.reinstateSubscription():!g.subscriptionPending&&this.connection.state==="connected"&&g.subscribe(),g},v.prototype.unsubscribe=function(p){var g=this.channels.find(p);g&&g.subscriptionPending?g.cancelSubscription():(g=this.channels.remove(p),g&&g.subscribed&&g.unsubscribe())},v.prototype.send_event=function(p,g,b){return this.connection.send_event(p,g,b)},v.prototype.shouldUseTLS=function(){return this.config.useTLS},v.prototype.signin=function(){this.user.signin()},v.instances=[],v.isReady=!1,v.logToConsole=!1,v.Runtime=yt,v.ScriptReceivers=yt.ScriptReceivers,v.DependenciesReceivers=yt.DependenciesReceivers,v.auth_callbacks=yt.auth_callbacks,v}(),qs=i.default=Xa;function Lu(v){if(v==null)throw"You must pass your app key when you instantiate Pusher."}yt.setup(Xa)}])})}(Wh)),Wh.exports}var Ek=Ak();const Pk=zv(Ek);/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function oa(e){return e+.5|0}const ji=(e,t,n)=>Math.max(Math.min(e,n),t);function Co(e){return ji(oa(e*2.55),0,255)}function Xi(e){return ji(oa(e*255),0,255)}function Si(e){return ji(oa(e/2.55)/100,0,1)}function im(e){return ji(oa(e*100),0,100)}const Mn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},yf=[..."0123456789ABCDEF"],Mk=e=>yf[e&15],Rk=e=>yf[(e&240)>>4]+yf[e&15],Dl=e=>(e&240)>>4===(e&15),Dk=e=>Dl(e.r)&&Dl(e.g)&&Dl(e.b)&&Dl(e.a);function Lk(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Mn[e[1]]*17,g:255&Mn[e[2]]*17,b:255&Mn[e[3]]*17,a:t===5?Mn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Mn[e[1]]<<4|Mn[e[2]],g:Mn[e[3]]<<4|Mn[e[4]],b:Mn[e[5]]<<4|Mn[e[6]],a:t===9?Mn[e[7]]<<4|Mn[e[8]]:255})),n}const Ik=(e,t)=>e<255?t(e):"";function Nk(e){var t=Dk(e)?Mk:Rk;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Ik(e.a,t):void 0}const Fk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Lb(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function Bk(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Hk(e,t,n){const i=Lb(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function zk(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function ed(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),l=(s+a)/2;let u,h,d;return s!==a&&(d=s-a,h=l>.5?d/(2-s-a):d/(s+a),u=zk(n,i,r,d,s),u=u*60+.5),[u|0,h||0,l]}function nd(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Xi)}function id(e,t,n){return nd(Lb,e,t,n)}function Wk(e,t,n){return nd(Hk,e,t,n)}function jk(e,t,n){return nd(Bk,e,t,n)}function Ib(e){return(e%360+360)%360}function $k(e){const t=Fk.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Co(+t[5]):Xi(+t[5]));const r=Ib(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Wk(r,s,a):t[1]==="hsv"?i=jk(r,s,a):i=id(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function Uk(e,t){var n=ed(e);n[0]=Ib(n[0]+t),n=id(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Vk(e){if(!e)return;const t=ed(e),n=t[0],i=im(t[1]),r=im(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Si(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const rm={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},sm={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function qk(){const e={},t=Object.keys(sm),n=Object.keys(rm);let i,r,s,a,l;for(i=0;i<t.length;i++){for(a=l=t[i],r=0;r<n.length;r++)s=n[r],l=l.replace(s,rm[s]);s=parseInt(sm[a],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let Ll;function Xk(e){Ll||(Ll=qk(),Ll.transparent=[0,0,0,0]);const t=Ll[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Yk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Kk(e){const t=Yk.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Co(a):ji(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Co(i):ji(i,0,255)),r=255&(t[4]?Co(r):ji(r,0,255)),s=255&(t[6]?Co(s):ji(s,0,255)),{r:i,g:r,b:s,a:n}}}function Gk(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Si(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const jh=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ls=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Jk(e,t,n){const i=ls(Si(e.r)),r=ls(Si(e.g)),s=ls(Si(e.b));return{r:Xi(jh(i+n*(ls(Si(t.r))-i))),g:Xi(jh(r+n*(ls(Si(t.g))-r))),b:Xi(jh(s+n*(ls(Si(t.b))-s))),a:e.a+n*(t.a-e.a)}}function Il(e,t,n){if(e){let i=ed(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=id(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Nb(e,t){return e&&Object.assign(t||{},e)}function om(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Xi(e[3]))):(t=Nb(e,{r:0,g:0,b:0,a:1}),t.a=Xi(t.a)),t}function Zk(e){return e.charAt(0)==="r"?Kk(e):$k(e)}class Uo{constructor(t){if(t instanceof Uo)return t;const n=typeof t;let i;n==="object"?i=om(t):n==="string"&&(i=Lk(t)||Xk(t)||Zk(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Nb(this._rgb);return t&&(t.a=Si(t.a)),t}set rgb(t){this._rgb=om(t)}rgbString(){return this._valid?Gk(this._rgb):void 0}hexString(){return this._valid?Nk(this._rgb):void 0}hslString(){return this._valid?Vk(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,l=2*a-1,u=i.a-r.a,h=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-h,i.r=255&h*i.r+s*r.r+.5,i.g=255&h*i.g+s*r.g+.5,i.b=255&h*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Jk(this._rgb,t._rgb,n)),this}clone(){return new Uo(this.rgb)}alpha(t){return this._rgb.a=Xi(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=oa(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Il(this._rgb,2,t),this}darken(t){return Il(this._rgb,2,-t),this}saturate(t){return Il(this._rgb,1,t),this}desaturate(t){return Il(this._rgb,1,-t),this}rotate(t){return Uk(this._rgb,t),this}}/*!
* Chart.js v4.5.0
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/function _i(){}const Qk=(()=>{let e=0;return()=>e++})();function Rt(e){return e==null}function ne(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 Lt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ue(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function yn(e,t){return ue(e)?e:t}function Tt(e,t){return typeof e>"u"?t:e}const tA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Fb=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Gt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Vt(e,t,n,i){let r,s,a;if(ne(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(Lt(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function gc(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function mc(e){if(ne(e))return e.map(mc);if(Lt(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=mc(e[n[r]]);return t}return e}function Bb(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function eA(e,t,n,i){if(!Bb(e))return;const r=t[e],s=n[e];Lt(r)&&Lt(s)?Vo(r,s,i):t[e]=mc(s)}function Vo(e,t,n){const i=ne(t)?t:[t],r=i.length;if(!Lt(e))return e;n=n||{};const s=n.merger||eA;let a;for(let l=0;l<r;++l){if(a=i[l],!Lt(a))continue;const u=Object.keys(a);for(let h=0,d=u.length;h<d;++h)s(u[h],e,a,n)}return e}function No(e,t){return Vo(e,t,{merger:nA})}function nA(e,t,n){if(!Bb(e))return;const i=t[e],r=n[e];Lt(i)&&Lt(r)?No(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=mc(r))}const am={"":e=>e,x:e=>e.x,y:e=>e.y};function iA(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function rA(e){const t=iA(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Yi(e,t){return(am[t]||(am[t]=rA(t)))(e)}function rd(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qo=e=>typeof e<"u",Ki=e=>typeof e=="function",lm=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function sA(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const zt=Math.PI,Qt=2*zt,oA=Qt+zt,vc=Number.POSITIVE_INFINITY,aA=zt/180,me=zt/2,vr=zt/4,cm=zt*2/3,$i=Math.log10,ri=Math.sign;function Fo(e,t,n){return Math.abs(e-t)<n}function um(e){const t=Math.round(e);e=Fo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor($i(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function lA(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function cA(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ys(e){return!cA(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function uA(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Hb(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function jn(e){return e*(zt/180)}function sd(e){return e*(180/zt)}function hm(e){if(!ue(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function zb(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*zt&&(s+=Qt),{angle:s,distance:r}}function _f(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function hA(e,t){return(e-t+oA)%Qt-zt}function We(e){return(e%Qt+Qt)%Qt}function Xo(e,t,n,i){const r=We(e),s=We(t),a=We(n),l=We(s-r),u=We(a-r),h=We(r-s),d=We(r-a);return r===s||r===a||i&&s===a||l>u&&h<d}function Pe(e,t,n){return Math.max(t,Math.min(n,e))}function fA(e){return Pe(e,-32768,32767)}function Ti(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function od(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const Ci=(e,t,n,i)=>od(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),dA=(e,t,n)=>od(e,n,i=>e[i][t]>=n);function pA(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const Wb=["push","pop","shift","splice","unshift"];function gA(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Wb.forEach(n=>{const i="_onData"+rd(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function fm(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Wb.forEach(s=>{delete e[s]}),delete e._chartjs)}function jb(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const $b=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Ub(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,$b.call(window,()=>{i=!1,e.apply(t,n)}))}}function mA(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const ad=e=>e==="start"?"left":e==="end"?"right":"center",ze=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,vA=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Vb(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:l,_parsed:u}=e,h=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=a.axis,{min:m,max:y,minDefined:x,maxDefined:S}=a.getUserBounds();if(x){if(r=Math.min(Ci(u,d,m).lo,n?i:Ci(t,d,a.getPixelForValue(m)).lo),h){const C=u.slice(0,r+1).reverse().findIndex(T=>!Rt(T[l.axis]));r-=Math.max(0,C)}r=Pe(r,0,i-1)}if(S){let C=Math.max(Ci(u,a.axis,y,!0).hi+1,n?0:Ci(t,d,a.getPixelForValue(y),!0).hi+1);if(h){const T=u.slice(C-1).findIndex(A=>!Rt(A[l.axis]));C+=Math.max(0,T)}s=Pe(C,r,i)-r}else s=i-r}return{start:r,count:s}}function qb(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const Nl=e=>e===0||e===1,dm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Qt/n)),pm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Qt/n)+1,Bo={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*me)+1,easeOutSine:e=>Math.sin(e*me),easeInOutSine:e=>-.5*(Math.cos(zt*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=>Nl(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=>Nl(e)?e:dm(e,.075,.3),easeOutElastic:e=>Nl(e)?e:pm(e,.075,.3),easeInOutElastic(e){return Nl(e)?e:e<.5?.5*dm(e*2,.1125,.45):.5+.5*pm(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-Bo.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?Bo.easeInBounce(e*2)*.5:Bo.easeOutBounce(e*2-1)*.5+.5};function ld(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function gm(e){return ld(e)?e:new Uo(e)}function $h(e){return ld(e)?e:new Uo(e).saturate(.5).darken(.1).hexString()}const bA=["x","y","borderWidth","radius","tension"],yA=["color","borderColor","backgroundColor"];function _A(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:yA},numbers:{type:"number",properties:bA}}),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 wA(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const mm=new Map;function xA(e,t){t=t||{};const n=e+JSON.stringify(t);let i=mm.get(n);return i||(i=new Intl.NumberFormat(e,t),mm.set(n,i)),i}function aa(e,t,n){return xA(t,n).format(e)}const Xb={values(e){return ne(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const h=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(h<1e-4||h>1e15)&&(r="scientific"),s=SA(e,n)}const a=$i(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),aa(e,i,u)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor($i(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Xb.numeric.call(this,e,t,n):""}};function SA(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 Rc={formatters:Xb};function TA(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:Rc.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 Lr=Object.create(null),wf=Object.create(null);function Ho(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function Uh(e,t,n){return typeof t=="string"?Vo(Ho(e,t),n):Vo(Ho(e,""),t)}class CA{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=i=>i.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=(i,r)=>$h(r.backgroundColor),this.hoverBorderColor=(i,r)=>$h(r.borderColor),this.hoverColor=(i,r)=>$h(r.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 Uh(this,t,n)}get(t){return Ho(this,t)}describe(t,n){return Uh(wf,t,n)}override(t,n){return Uh(Lr,t,n)}route(t,n,i,r){const s=Ho(this,t),a=Ho(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[l],h=a[r];return Lt(u)?Object.assign({},h,u):Tt(u,h)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var ie=new CA({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[_A,wA,TA]);function OA(e){return!e||Rt(e.size)||Rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function bc(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function kA(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const l=n.length;let u,h,d,m,y;for(u=0;u<l;u++)if(m=n[u],m!=null&&!ne(m))a=bc(e,r,s,a,m);else if(ne(m))for(h=0,d=m.length;h<d;h++)y=m[h],y!=null&&!ne(y)&&(a=bc(e,r,s,a,y));e.restore();const x=s.length/2;if(x>n.length){for(u=0;u<x;u++)delete r[s[u]];s.splice(0,x)}return a}function br(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function vm(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function xf(e,t,n,i){Yb(e,t,n,i,null)}function Yb(e,t,n,i,r){let s,a,l,u,h,d,m,y;const x=t.pointStyle,S=t.rotation,C=t.radius;let T=(S||0)*aA;if(x&&typeof x=="object"&&(s=x.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(T),e.drawImage(x,-x.width/2,-x.height/2,x.width,x.height),e.restore();return}if(!(isNaN(C)||C<=0)){switch(e.beginPath(),x){default:r?e.ellipse(n,i,r/2,C,0,0,Qt):e.arc(n,i,C,0,Qt),e.closePath();break;case"triangle":d=r?r/2:C,e.moveTo(n+Math.sin(T)*d,i-Math.cos(T)*C),T+=cm,e.lineTo(n+Math.sin(T)*d,i-Math.cos(T)*C),T+=cm,e.lineTo(n+Math.sin(T)*d,i-Math.cos(T)*C),e.closePath();break;case"rectRounded":h=C*.516,u=C-h,a=Math.cos(T+vr)*u,m=Math.cos(T+vr)*(r?r/2-h:u),l=Math.sin(T+vr)*u,y=Math.sin(T+vr)*(r?r/2-h:u),e.arc(n-m,i-l,h,T-zt,T-me),e.arc(n+y,i-a,h,T-me,T),e.arc(n+m,i+l,h,T,T+me),e.arc(n-y,i+a,h,T+me,T+zt),e.closePath();break;case"rect":if(!S){u=Math.SQRT1_2*C,d=r?r/2:u,e.rect(n-d,i-u,2*d,2*u);break}T+=vr;case"rectRot":m=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,y=Math.sin(T)*(r?r/2:C),e.moveTo(n-m,i-l),e.lineTo(n+y,i-a),e.lineTo(n+m,i+l),e.lineTo(n-y,i+a),e.closePath();break;case"crossRot":T+=vr;case"cross":m=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,y=Math.sin(T)*(r?r/2:C),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+y,i-a),e.lineTo(n-y,i+a);break;case"star":m=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,y=Math.sin(T)*(r?r/2:C),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+y,i-a),e.lineTo(n-y,i+a),T+=vr,m=Math.cos(T)*(r?r/2:C),a=Math.cos(T)*C,l=Math.sin(T)*C,y=Math.sin(T)*(r?r/2:C),e.moveTo(n-m,i-l),e.lineTo(n+m,i+l),e.moveTo(n+y,i-a),e.lineTo(n-y,i+a);break;case"line":a=r?r/2:Math.cos(T)*C,l=Math.sin(T)*C,e.moveTo(n-a,i-l),e.lineTo(n+a,i+l);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(T)*(r?r/2:C),i+Math.sin(T)*C);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Oi(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 Dc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Lc(e){e.restore()}function AA(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function EA(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function PA(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Rt(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 MA(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,u=n-s.actualBoundingBoxAscent,h=n+s.actualBoundingBoxDescent,d=r.strikethrough?(u+h)/2:h;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,d),e.lineTo(l,d),e.stroke()}}function RA(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ir(e,t,n,i,r,s={}){const a=ne(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let u,h;for(e.save(),e.font=r.string,PA(e,s),u=0;u<a.length;++u)h=a[u],s.backdrop&&RA(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),Rt(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(h,n,i,s.maxWidth)),e.fillText(h,n,i,s.maxWidth),MA(e,n,i,h,s),i+=Number(r.lineHeight);e.restore()}function Yo(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*zt,zt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,zt,me,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,me,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-me,!0),e.lineTo(n+a.topLeft,i)}const DA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,LA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function IA(e,t){const n=(""+e).match(DA);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 NA=e=>+e||0;function cd(e,t){const n={},i=Lt(t),r=i?Object.keys(t):t,s=Lt(e)?i?a=>Tt(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=NA(s(a));return n}function Kb(e){return cd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return cd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(e){const t=Kb(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ke(e,t){e=e||{},t=t||ie.font;let n=Tt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Tt(e.style,t.style);i&&!(""+i).match(LA)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Tt(e.family,t.family),lineHeight:IA(Tt(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Tt(e.weight,t.weight),string:""};return r.string=OA(r),r}function Oo(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function FA(e,t,n){const{min:i,max:r}=e,s=Fb(t,(r-i)/2),a=(l,u)=>n&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ji(e,t){return Object.assign(Object.create(e),t)}function ud(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=Qb("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>ud([l,...e],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete e[0][u],!0},get(l,u){return Jb(l,u,()=>VA(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return ym(l).includes(u)},ownKeys(l){return ym(l)},set(l,u,h){const d=l._storage||(l._storage=r());return l[u]=d[u]=h,delete l._keys,!0}})}function _s(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Gb(e,i),setContext:s=>_s(e,s,n,i),override:s=>_s(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,l){return Jb(s,a,()=>HA(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,l){return e[a]=l,delete s[a],!0}})}function Gb(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:Ki(n)?n:()=>n,isIndexable:Ki(i)?i:()=>i}}const BA=(e,t)=>e?e+rd(t):t,hd=(e,t)=>Lt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Jb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function HA(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return Ki(l)&&a.isScriptable(t)&&(l=zA(t,l,e,n)),ne(l)&&l.length&&(l=WA(t,l,e,a.isIndexable)),hd(t,l)&&(l=_s(l,r,s&&s[t],a)),l}function zA(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let u=t(s,a||i);return l.delete(e),hd(e,u)&&(u=fd(r._scopes,r,e,u)),u}function WA(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(Lt(t[0])){const u=t,h=r._scopes.filter(d=>d!==u);t=[];for(const d of u){const m=fd(h,r,e,d);t.push(_s(m,s,a&&a[e],l))}}return t}function Zb(e,t,n){return Ki(e)?e(t,n):e}const jA=(e,t)=>e===!0?t:typeof e=="string"?Yi(t,e):void 0;function $A(e,t,n,i,r){for(const s of t){const a=jA(n,s);if(a){e.add(a);const l=Zb(a._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function fd(e,t,n,i){const r=t._rootScopes,s=Zb(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=bm(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=bm(l,a,s,u,i),u===null)?!1:ud(Array.from(l),[""],r,s,()=>UA(t,n,i))}function bm(e,t,n,i,r){for(;n;)n=$A(e,t,n,i,r);return n}function UA(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return ne(r)&&Lt(n)?n:r||{}}function VA(e,t,n,i){let r;for(const s of t)if(r=Qb(BA(s,e),n),typeof r<"u")return hd(e,r)?fd(n,i,e,r):r}function Qb(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function ym(e){let t=e._keys;return t||(t=e._keys=qA(e._scopes)),t}function qA(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ty(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let l,u,h,d;for(l=0,u=i;l<u;++l)h=l+n,d=t[h],a[l]={r:r.parse(Yi(d,s),h)};return a}const XA=Number.EPSILON||1e-14,ws=(e,t)=>t<e.length&&!e[t].skip&&e[t],ey=e=>e==="x"?"y":"x";function YA(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,l=_f(s,r),u=_f(a,s);let h=l/(l+u),d=u/(l+u);h=isNaN(h)?0:h,d=isNaN(d)?0:d;const m=i*h,y=i*d;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+y*(a.x-r.x),y:s.y+y*(a.y-r.y)}}}function KA(e,t,n){const i=e.length;let r,s,a,l,u,h=ws(e,0);for(let d=0;d<i-1;++d)if(u=h,h=ws(e,d+1),!(!u||!h)){if(Fo(t[d],0,XA)){n[d]=n[d+1]=0;continue}r=n[d]/t[d],s=n[d+1]/t[d],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(a=3/Math.sqrt(l),n[d]=r*a*t[d],n[d+1]=s*a*t[d])}}function GA(e,t,n="x"){const i=ey(n),r=e.length;let s,a,l,u=ws(e,0);for(let h=0;h<r;++h){if(a=l,l=u,u=ws(e,h+1),!l)continue;const d=l[n],m=l[i];a&&(s=(d-a[n])/3,l[`cp1${n}`]=d-s,l[`cp1${i}`]=m-s*t[h]),u&&(s=(u[n]-d)/3,l[`cp2${n}`]=d+s,l[`cp2${i}`]=m+s*t[h])}}function JA(e,t="x"){const n=ey(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,l,u,h=ws(e,0);for(a=0;a<i;++a)if(l=u,u=h,h=ws(e,a+1),!!u){if(h){const d=h[t]-u[t];r[a]=d!==0?(h[n]-u[n])/d:0}s[a]=l?h?ri(r[a-1])!==ri(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}KA(e,r,s),GA(e,s,t)}function Fl(e,t,n){return Math.max(Math.min(e,n),t)}function ZA(e,t){let n,i,r,s,a,l=Oi(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=l,l=n<i-1&&Oi(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=Fl(r.cp1x,t.left,t.right),r.cp1y=Fl(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=Fl(r.cp2x,t.left,t.right),r.cp2y=Fl(r.cp2y,t.top,t.bottom)))}function QA(e,t,n,i,r){let s,a,l,u;if(t.spanGaps&&(e=e.filter(h=>!h.skip)),t.cubicInterpolationMode==="monotone")JA(e,r);else{let h=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)l=e[s],u=YA(h,l,e[Math.min(s+1,a-(i?0:1))%a],t.tension),l.cp1x=u.previous.x,l.cp1y=u.previous.y,l.cp2x=u.next.x,l.cp2y=u.next.y,h=l}t.capBezierPoints&&ZA(e,n)}function dd(){return typeof window<"u"&&typeof document<"u"}function pd(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function yc(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const Ic=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function tE(e,t){return Ic(e).getPropertyValue(t)}const eE=["top","right","bottom","left"];function Pr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=eE[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const nE=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function iE(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(nE(r,s,e.target))l=r,u=s;else{const h=t.getBoundingClientRect();l=i.clientX-h.left,u=i.clientY-h.top,a=!0}return{x:l,y:u,box:a}}function xr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Ic(n),s=r.boxSizing==="border-box",a=Pr(r,"padding"),l=Pr(r,"border","width"),{x:u,y:h,box:d}=iE(e,n),m=a.left+(d&&l.left),y=a.top+(d&&l.top);let{width:x,height:S}=t;return s&&(x-=a.width+l.width,S-=a.height+l.height),{x:Math.round((u-m)/x*n.width/i),y:Math.round((h-y)/S*n.height/i)}}function rE(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&pd(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),l=Ic(s),u=Pr(l,"border","width"),h=Pr(l,"padding");t=a.width-h.width-u.width,n=a.height-h.height-u.height,i=yc(l.maxWidth,s,"clientWidth"),r=yc(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||vc,maxHeight:r||vc}}const Bl=e=>Math.round(e*10)/10;function sE(e,t,n,i){const r=Ic(e),s=Pr(r,"margin"),a=yc(r.maxWidth,e,"clientWidth")||vc,l=yc(r.maxHeight,e,"clientHeight")||vc,u=rE(e,t,n);let{width:h,height:d}=u;if(r.boxSizing==="content-box"){const y=Pr(r,"border","width"),x=Pr(r,"padding");h-=x.width+y.width,d-=x.height+y.height}return h=Math.max(0,h-s.width),d=Math.max(0,i?h/i:d-s.height),h=Bl(Math.min(h,a,u.maxWidth)),d=Bl(Math.min(d,l,u.maxHeight)),h&&!d&&(d=Bl(h/2)),(t!==void 0||n!==void 0)&&i&&u.height&&d>u.height&&(d=u.height,h=Bl(Math.floor(d*i))),{width:h,height:d}}function _m(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const oE=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};dd()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function wm(e,t){const n=tE(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Sr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function aE(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function lE(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=Sr(e,r,n),l=Sr(r,s,n),u=Sr(s,t,n),h=Sr(a,l,n),d=Sr(l,u,n);return Sr(h,d,n)}const cE=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,i){return n-i},leftForLtr(n,i){return n-i}}},uE=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function fs(e,t,n){return e?cE(t,n):uE()}function ny(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function iy(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ry(e){return e==="angle"?{between:Xo,compare:hA,normalize:We}:{between:Ti,compare:(t,n)=>t-n,normalize:t=>t}}function xm({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function hE(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=ry(i),u=t.length;let{start:h,end:d,loop:m}=e,y,x;if(m){for(h+=u,d+=u,y=0,x=u;y<x&&a(l(t[h%u][i]),r,s);++y)h--,d--;h%=u,d%=u}return d<h&&(d+=u),{start:h,end:d,loop:m,style:e.style}}function sy(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:l,between:u,normalize:h}=ry(i),{start:d,end:m,loop:y,style:x}=hE(e,t,n),S=[];let C=!1,T=null,A,M,B;const D=()=>u(r,B,A)&&l(r,B)!==0,R=()=>l(s,A)===0||u(s,B,A),N=()=>C||D(),I=()=>!C||R();for(let j=d,q=d;j<=m;++j)M=t[j%a],!M.skip&&(A=h(M[i]),A!==B&&(C=u(A,r,s),T===null&&N()&&(T=l(A,r)===0?j:q),T!==null&&I()&&(S.push(xm({start:T,end:j,loop:y,count:a,style:x})),T=null),q=j,B=A));return T!==null&&S.push(xm({start:T,end:m,loop:y,count:a,style:x})),S}function oy(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=sy(i[r],e.points,t);s.length&&n.push(...s)}return n}function fE(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function dE(e,t,n,i){const r=e.length,s=[];let a=t,l=e[t],u;for(u=t+1;u<=n;++u){const h=e[u%r];h.skip||h.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=h.stop?u:null):(a=u,l.skip&&(t=u)),l=h}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function pE(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=fE(n,r,s,i);if(i===!0)return Sm(e,[{start:a,end:l,loop:s}],n,t);const u=l<a?l+r:l,h=!!e._fullLoop&&a===0&&l===r-1;return Sm(e,dE(n,a,u,h),n,t)}function Sm(e,t,n,i){return!i||!i.setContext||!n?t:gE(e,t,n,i)}function gE(e,t,n,i){const r=e._chart.getContext(),s=Tm(e.options),{_datasetIndex:a,options:{spanGaps:l}}=e,u=n.length,h=[];let d=s,m=t[0].start,y=m;function x(S,C,T,A){const M=l?-1:1;if(S!==C){for(S+=u;n[S%u].skip;)S-=M;for(;n[C%u].skip;)C+=M;S%u!==C%u&&(h.push({start:S%u,end:C%u,loop:T,style:A}),d=A,m=C%u)}}for(const S of t){m=l?m:S.start;let C=n[m%u],T;for(y=m+1;y<=S.end;y++){const A=n[y%u];T=Tm(i.setContext(Ji(r,{type:"segment",p0:C,p1:A,p0DataIndex:(y-1)%u,p1DataIndex:y%u,datasetIndex:a}))),mE(T,d)&&x(m,y-1,S.loop,d),C=A,d=T}m<y-1&&x(m,y-1,S.loop,d)}return h}function Tm(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function mE(e,t){if(!t)return!1;const n=[],i=function(r,s){return ld(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Hl(e,t,n){return e.options.clip?e[n]:t[n]}function vE(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Hl(n,t,"left"),right:Hl(n,t,"right"),top:Hl(i,t,"top"),bottom:Hl(i,t,"bottom")}:t}function ay(e,t){const n=t._clip;if(n.disabled)return!1;const i=vE(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}/*!
* Chart.js v4.5.0
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/class bE{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(l=>l({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=$b.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}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((i,r)=>Math.max(i,r._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 i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var wi=new bE;const Cm="transparent",yE={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=gm(e||Cm),r=i.valid&&gm(t||Cm);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class _E{constructor(t,n,i,r){const s=n[i];r=Oo([t.to,r,s,t.from]);const a=Oo([t.from,s,r]);this._active=!0,this._fn=t.fn||yE[t.type||typeof a],this._easing=Bo[t.easing]||Bo.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=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Oo([t.to,n,r,t.from]),this._from=Oo([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||n<i),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=s;return}u=n/i%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class ly{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Lt(t))return;const n=Object.keys(ie.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Lt(s))return;const a={};for(const l of n)a[l]=s[l];(ne(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=xE(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&wE(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const h=a[u];if(h.charAt(0)==="$")continue;if(h==="options"){r.push(...this._animateOptions(t,n));continue}const d=n[h];let m=s[h];const y=i.get(h);if(m)if(y&&m.active()){m.update(y,d,l);continue}else m.cancel();if(!y||!y.duration){t[h]=d;continue}s[h]=m=new _E(y,t,h,d),r.push(m)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return wi.add(this._chart,i),!0}}function wE(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function xE(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 Om(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function SE(e,t,n){if(n===!1)return!1;const i=Om(e,n),r=Om(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function TE(e){let t,n,i,r;return Lt(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function cy(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function km(e,t,n,i={}){const r=e.keys,s=i.mode==="single";let a,l,u,h;if(t===null)return;let d=!1;for(a=0,l=r.length;a<l;++a){if(u=+r[a],u===n){if(d=!0,i.all)continue;break}h=e.values[u],ue(h)&&(s||t===0||ri(t)===ri(h))&&(t+=h)}return!d&&!i.all?0:t}function CE(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),l=new Array(a.length);let u,h,d;for(u=0,h=a.length;u<h;++u)d=a[u],l[u]={[r]:d,[s]:e[d]};return l}function Vh(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function OE(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function kE(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function AE(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Am(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function Em(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,h=a.axis,d=OE(s,a,i),m=t.length;let y;for(let x=0;x<m;++x){const S=t[x],{[u]:C,[h]:T}=S,A=S._stacks||(S._stacks={});y=A[h]=AE(r,d,C),y[l]=T,y._top=Am(y,a,!0,i.type),y._bottom=Am(y,a,!1,i.type);const M=y._visualValues||(y._visualValues={});M[l]=T}}function qh(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function EE(e,t){return Ji(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function PE(e,t,n){return Ji(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function vo(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const Xh=e=>e==="reset"||e==="none",Pm=(e,t)=>t?e:Object.assign({},e),ME=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:cy(n,!0),values:null};class $n{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=Vh(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&&vo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(m,y,x,S)=>m==="x"?y:m==="r"?S:x,s=n.xAxisID=Tt(i.xAxisID,qh(t,"x")),a=n.yAxisID=Tt(i.yAxisID,qh(t,"y")),l=n.rAxisID=Tt(i.rAxisID,qh(t,"r")),u=n.indexAxis,h=n.iAxisID=r(u,s,a,l),d=n.vAxisID=r(u,a,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(h),n.vScale=this.getScaleForId(d)}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&&fm(this._data,this),t._stacked&&vo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Lt(n)){const r=this._cachedMeta;this._data=CE(n,r)}else if(i!==n){if(i){fm(i,this);const r=this._cachedMeta;vo(r),r._parsed=[]}n&&Object.isExtensible(n)&&gA(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,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=Vh(n.vScale,n),n.stack!==i.stack&&(r=!0,vo(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(Em(this,n._parsed),n._stacked=Vh(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&n===r.length?!0:i._sorted,h=t>0&&i._parsed[t-1],d,m,y;if(this._parsing===!1)i._parsed=r,i._sorted=!0,y=r;else{ne(r[t])?y=this.parseArrayData(i,r,t,n):Lt(r[t])?y=this.parseObjectData(i,r,t,n):y=this.parsePrimitiveData(i,r,t,n);const x=()=>m[l]===null||h&&m[l]<h[l];for(d=0;d<n;++d)i._parsed[d+t]=m=y[d],u&&(x()&&(u=!1),h=m);i._sorted=u}a&&Em(this,y)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,l=s.axis,u=a.axis,h=s.getLabels(),d=s===a,m=new Array(r);let y,x,S;for(y=0,x=r;y<x;++y)S=y+i,m[y]={[l]:d||s.parse(h[S],S),[u]:a.parse(n[S],S)};return m}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,l=new Array(r);let u,h,d,m;for(u=0,h=r;u<h;++u)d=u+i,m=n[d],l[u]={x:s.parse(m[0],d),y:a.parse(m[1],d)};return l}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,h=new Array(r);let d,m,y,x;for(d=0,m=r;d<m;++d)y=d+i,x=n[y],h[d]={x:s.parse(Yi(x,l),y),y:a.parse(Yi(x,u),y)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],l={keys:cy(r,!0),values:n._stacks[t.axis]._visualValues};return km(l,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const l=r&&i._stacks[n.axis];r&&l&&(r.values=l,a=km(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,l=this._getOtherScale(t),u=ME(n,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:m}=kE(l);let y,x;function S(){x=r[y];const C=x[l.axis];return!ue(x[t.axis])||d>C||m<C}for(y=0;y<a&&!(!S()&&(this.updateRangeFromParsed(h,t,x,u),s));++y);if(s){for(y=a-1;y>=0;--y)if(!S()){this.updateRangeFromParsed(h,t,x,u);break}}return h}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],ue(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=TE(Tt(this.options.clip,SE(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,a=[],l=this._drawStart||0,u=this._drawCount||r.length-l,h=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,s,l,u),d=l;d<l+u;++d){const m=r[d];m.hidden||(m.active&&h?a.push(m):m.draw(t,s))}for(d=0;d<a.length;++d)a[d].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=PE(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=EE(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,l=s[a],u=this.enableOptionSharing&&qo(i);if(l)return Pm(l,u);const h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),m=r?[`${t}Hover`,"hover",t,""]:[t,""],y=h.getOptionScopes(this.getDataset(),d),x=Object.keys(ie.elements[t]),S=()=>this.getContext(i,r,n),C=h.resolveNamedOptions(y,x,S,m);return C.$shared&&(C.$shared=u,s[a]=Object.freeze(Pm(C,u))),C}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const d=this.chart.config,m=d.datasetAnimationScopeKeys(this._type,n),y=d.getOptionScopes(this.getDataset(),m);u=d.createResolver(y,this.getContext(t,i,n))}const h=new ly(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Xh(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){Xh(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!Xh(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[l,u,h]of this._syncList)this[l](u,h);this._syncList=[];const r=i.length,s=n.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let l;const u=h=>{for(h.length+=n,l=h.length-1;l>=a;l--)h[l]=h[l-n]};for(u(s),l=t;l<a;++l)s[l]=new this.dataElementType;this._parsing&&u(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&vo(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](i,r)}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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ot($n,"defaults",{}),ot($n,"datasetElementType",null),ot($n,"dataElementType",null);function RE(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=jb(i.sort((r,s)=>r-s))}return e._cache.$bar}function DE(e){const t=e.iScale,n=RE(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(qo(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),u();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),u();return i}function LE(e,t,n,i){const r=n.barThickness;let s,a;return Rt(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function IE(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const u=n.categoryPercentage;a===null&&(a=s-(l===null?t.end-t.start:l-s)),l===null&&(l=s+s-a);const h=s-(s-Math.min(a,l))/2*u;return{chunk:Math.abs(l-a)/2*u/i,ratio:n.barPercentage,start:h}}function NE(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[1],i),a=Math.min(r,s),l=Math.max(r,s);let u=a,h=l;Math.abs(a)>Math.abs(l)&&(u=l,h=a),t[n.axis]=h,t._custom={barStart:u,barEnd:h,start:r,end:s,min:a,max:l}}function uy(e,t,n,i){return ne(e)?NE(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Mm(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),l=r===s,u=[];let h,d,m,y;for(h=n,d=n+i;h<d;++h)y=t[h],m={},m[r.axis]=l||r.parse(a[h],h),u.push(uy(y,m,s,h));return u}function Yh(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function FE(e,t,n){return e!==0?ri(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function BE(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function HE(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:u,top:h,bottom:d}=BE(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=h:(n._bottom||0)===i?r=d:(s[Rm(d,a,l,u)]=!0,r=h)),s[Rm(r,a,l,u)]=!0,e.borderSkipped=s}function Rm(e,t,n,i){return i?(e=zE(e,t,n),e=Dm(e,n,t)):e=Dm(e,t,n),e}function zE(e,t,n){return e===t?n:e===n?t:e}function Dm(e,t,n){return e==="start"?t:e==="end"?n:e}function WE(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class tc extends $n{parsePrimitiveData(t,n,i,r){return Mm(t,n,i,r)}parseArrayData(t,n,i,r){return Mm(t,n,i,r)}parseObjectData(t,n,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:l="x",yAxisKey:u="y"}=this._parsing,h=s.axis==="x"?l:u,d=a.axis==="x"?l:u,m=[];let y,x,S,C;for(y=i,x=i+r;y<x;++y)C=n[y],S={},S[s.axis]=s.parse(Yi(C,h),y),m.push(uy(Yi(C,d),S,a,y));return m}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,l=Yh(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:l}}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,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:l}}=this,u=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,r);for(let x=n;x<n+i;x++){const S=this.getParsed(x),C=s||Rt(S[l.axis])?{base:u,head:u}:this._calculateBarValuePixels(x),T=this._calculateBarIndexPixels(x,d),A=(S._stacks||{})[l.axis],M={horizontal:h,base:C.base,enableBorderRadius:!A||Yh(S._custom)||a===A._top||a===A._bottom,x:h?C.head:T.center,y:h?T.center:C.head,height:h?T.size:Math.abs(C.size),width:h?Math.abs(C.size):T.size};y&&(M.options=m||this.resolveDataElementOptions(x,t[x].active?"active":r));const B=M.options||t[x].options;HE(M,B,A,a),WE(M,B,d.ratio),this.updateElement(t[x],x,M,r)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),u=l&&l[i.axis],h=d=>{const m=d._parsed.find(x=>x[i.axis]===u),y=m&&m[d.vScale.axis];if(Rt(y)||isNaN(y))return!0};for(const d of r)if(!(n!==void 0&&h(d))&&((s===!1||a.indexOf(d.stack)===-1||s===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Tt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const l=t.barThickness;return{min:l||DE(n),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,l=s||0,u=this.getParsed(t),h=u._custom,d=Yh(h);let m=u[n.axis],y=0,x=i?this.applyStack(n,u,i):m,S,C;x!==m&&(y=x-m,x=m),d&&(m=h.barStart,x=h.barEnd-h.barStart,m!==0&&ri(m)!==ri(h.barEnd)&&(y=0),y+=m);const T=!Rt(s)&&!d?s:y;let A=n.getPixelForValue(T);if(this.chart.getDataVisibility(t)?S=n.getPixelForValue(y+x):S=A,C=S-A,Math.abs(C)<a){C=FE(C,n,l)*a,m===l&&(A-=C/2);const M=n.getPixelForDecimal(0),B=n.getPixelForDecimal(1),D=Math.min(M,B),R=Math.max(M,B);A=Math.max(Math.min(A,R),D),S=A+C,i&&!d&&(u._stacks[n.axis]._visualValues[r]=n.getValueForPixel(S)-n.getValueForPixel(A))}if(A===n.getPixelForValue(l)){const M=ri(C)*n.getLineWidthForValue(l)/2;A+=M,C-=M}return{size:C,base:A,head:S,center:S+C/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=Tt(r.maxBarThickness,1/0);let l,u;const h=this._getAxisCount();if(n.grouped){const d=s?this._getStackCount(t):n.stackCount,m=r.barThickness==="flex"?IE(t,n,r,d*h):LE(t,n,r,d*h),y=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,x=this._getAxis().indexOf(Tt(y,this.getFirstScaleIdForIndexAxis())),S=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+x;l=m.start+m.chunk*S+m.chunk/2,u=Math.min(a,m.chunk*m.ratio)}else l=i.getPixelForValue(this.getParsed(t)[i.axis],t),u=Math.min(a,n.min*n.ratio);return{base:l-u/2,head:l+u/2,center:l,size:u}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}ot(tc,"id","bar"),ot(tc,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ot(tc,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ec extends $n{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Tt(l[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const l=n[i+a];s[a]._custom=Tt(l&&l.r&&+l.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),h=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(h?", "+h:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,r),d=a.axis,m=l.axis;for(let y=n;y<n+i;y++){const x=t[y],S=!s&&this.getParsed(y),C={},T=C[d]=s?a.getPixelForDecimal(.5):a.getPixelForValue(S[d]),A=C[m]=s?l.getBasePixel():l.getPixelForValue(S[m]);C.skip=isNaN(T)||isNaN(A),h&&(C.options=u||this.resolveDataElementOptions(y,x.active?"active":r),s&&(C.options.radius=0)),this.updateElement(x,y,C,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=Tt(i&&i._custom,s),r}}ot(ec,"id","bubble"),ot(ec,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),ot(ec,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function jE(e,t,n){let i=1,r=1,s=0,a=0;if(t<Qt){const l=e,u=l+t,h=Math.cos(l),d=Math.sin(l),m=Math.cos(u),y=Math.sin(u),x=(B,D,R)=>Xo(B,l,u,!0)?1:Math.max(D,D*n,R,R*n),S=(B,D,R)=>Xo(B,l,u,!0)?-1:Math.min(D,D*n,R,R*n),C=x(0,h,m),T=x(me,d,y),A=S(zt,h,m),M=S(zt+me,d,y);i=(C-A)/2,r=(T-M)/2,s=-(C+A)/2,a=-(T+M)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Or extends $n{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 i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Lt(i[t])){const{key:u="value"}=this._parsing;s=h=>+Yi(i[h],u)}let a,l;for(a=t,l=t+n;a<l;++a)r._parsed[a]=s(a)}}_getRotation(){return jn(this.options.rotation-90)}_getCircumference(){return jn(this.options.circumference)}_getRotationExtents(){let t=Qt,n=-Qt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(i.width,i.height)-a)/2,0),u=Math.min(tA(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:m}=this._getRotationExtents(),{ratioX:y,ratioY:x,offsetX:S,offsetY:C}=jE(m,d,u),T=(i.width-a)/y,A=(i.height-a)/x,M=Math.max(Math.min(T,A)/2,0),B=Fb(this.options.radius,M),D=Math.max(B*u,0),R=(B-D)/this._getVisibleDatasetWeightTotal();this.offsetX=S*B,this.offsetY=C*B,r.total=this.calculateTotal(),this.outerRadius=B-R*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-R*h,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/Qt)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,l=a.chartArea,h=a.options.animation,d=(l.left+l.right)/2,m=(l.top+l.bottom)/2,y=s&&h.animateScale,x=y?0:this.innerRadius,S=y?0:this.outerRadius,{sharedOptions:C,includeOptions:T}=this._getSharedOptions(n,r);let A=this._getRotation(),M;for(M=0;M<n;++M)A+=this._circumference(M,s);for(M=n;M<n+i;++M){const B=this._circumference(M,s),D=t[M],R={x:d+this.offsetX,y:m+this.offsetY,startAngle:A,endAngle:A+B,circumference:B,outerRadius:S,innerRadius:x};T&&(R.options=C||this.resolveDataElementOptions(M,D.active?"active":r)),A+=B,this.updateElement(D,M,R,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Qt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=aa(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,l=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)u=l.resolveDataElementOptions(r),u.borderAlign!=="inner"&&(n=Math.max(n,u.borderWidth||0,u.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Tt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ot(Or,"id","doughnut"),ot(Or,"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"}),ot(Or,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ot(Or,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class nc extends $n{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:l,count:u}=Vb(n,r,a);this._drawStart=l,this._drawCount=u,qb(n)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:h},t),this.updateElements(r,l,u,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:m}=this._getSharedOptions(n,r),y=a.axis,x=l.axis,{spanGaps:S,segment:C}=this.options,T=ys(S)?S:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none",M=n+i,B=t.length;let D=n>0&&this.getParsed(n-1);for(let R=0;R<B;++R){const N=t[R],I=A?N:{};if(R<n||R>=M){I.skip=!0;continue}const j=this.getParsed(R),q=Rt(j[x]),F=I[y]=a.getPixelForValue(j[y],R),H=I[x]=s||q?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,j,u):j[x],R);I.skip=isNaN(F)||isNaN(H)||q,I.stop=R>0&&Math.abs(j[y]-D[y])>T,C&&(I.parsed=j,I.raw=h.data[R]),m&&(I.options=d||this.resolveDataElementOptions(R,N.active?"active":r)),A||this.updateElement(N,R,I,r),D=j}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ot(nc,"id","line"),ot(nc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ot(nc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class zo extends $n{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=aa(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return ty.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,m=h.yCenter,y=h.getIndexAngle(0)-.5*zt;let x=y,S;const C=360/this.countVisibleElements();for(S=0;S<n;++S)x+=this._computeAngle(S,r,C);for(S=n;S<n+i;S++){const T=t[S];let A=x,M=x+this._computeAngle(S,r,C),B=a.getDataVisibility(S)?h.getDistanceFromCenterForValue(this.getParsed(S).r):0;x=M,s&&(u.animateScale&&(B=0),u.animateRotate&&(A=M=y));const D={x:d,y:m,innerRadius:0,outerRadius:B,startAngle:A,endAngle:M,options:this.resolveDataElementOptions(S,T.active?"active":r)};this.updateElement(T,S,D,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?jn(this.resolveDataElementOptions(t,n).angle||i):0}}ot(zo,"id","polarArea"),ot(zo,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ot(zo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Sf extends Or{}ot(Sf,"id","pie"),ot(Sf,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ic extends $n{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return ty.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=n;l<n+i;l++){const u=t[l],h=this.resolveDataElementOptions(l,u.active?"active":r),d=s.getPointPositionForValue(l,this.getParsed(l).r),m=a?s.xCenter:d.x,y=a?s.yCenter:d.y,x={x:m,y,angle:d.angle,skip:isNaN(m)||isNaN(y),options:h};this.updateElement(u,l,x,r)}}}ot(ic,"id","radar"),ot(ic,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),ot(ic,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class rc extends $n{getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+l+", "+u+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=Vb(n,i,r);if(this._drawStart=s,this._drawCount=a,qb(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:u}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!u._decimated,l.points=i;const h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:h},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(n,r),m=this.getSharedOptions(d),y=this.includeOptions(r,m),x=a.axis,S=l.axis,{spanGaps:C,segment:T}=this.options,A=ys(C)?C:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||s||r==="none";let B=n>0&&this.getParsed(n-1);for(let D=n;D<n+i;++D){const R=t[D],N=this.getParsed(D),I=M?R:{},j=Rt(N[S]),q=I[x]=a.getPixelForValue(N[x],D),F=I[S]=s||j?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,N,u):N[S],D);I.skip=isNaN(q)||isNaN(F)||j,I.stop=D>0&&Math.abs(N[x]-B[x])>A,T&&(I.parsed=N,I.raw=h.data[D]),y&&(I.options=m||this.resolveDataElementOptions(D,R.active?"active":r)),M||this.updateElement(R,D,I,r),B=N}this.updateSharedOptions(m,r,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let u=n.length-1;u>=0;--u)l=Math.max(l,n[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}ot(rc,"id","scatter"),ot(rc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ot(rc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var $E=Object.freeze({__proto__:null,BarController:tc,BubbleController:ec,DoughnutController:Or,LineController:nc,PieController:Sf,PolarAreaController:zo,RadarController:ic,ScatterController:rc});function yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class gd{constructor(t){ot(this,"options");this.options=t||{}}static override(t){Object.assign(gd.prototype,t)}init(){}formats(){return yr()}parse(){return yr()}format(){return yr()}add(){return yr()}diff(){return yr()}startOf(){return yr()}endOf(){return yr()}}var UE={_date:gd};function VE(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,l=r._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const h=l._reversePixels?dA:Ci;if(i){if(r._sharedOptions){const d=s[0],m=typeof d.getRange=="function"&&d.getRange(t);if(m){const y=h(s,t,n-m),x=h(s,t,n+m);return{lo:y.lo,hi:x.hi}}}}else{const d=h(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:y}=e,x=y.slice(0,d.lo+1).reverse().findIndex(C=>!Rt(C[m.axis]));d.lo-=Math.max(0,x);const S=y.slice(d.hi).findIndex(C=>!Rt(C[m.axis]));d.hi+=Math.max(0,S)}return d}}return{lo:0,hi:s.length-1}}function Nc(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let l=0,u=s.length;l<u;++l){const{index:h,data:d}=s[l],{lo:m,hi:y}=VE(s[l],t,a,r);for(let x=m;x<=y;++x){const S=d[x];S.skip||i(S,h,x)}}}function qE(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function Kh(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||Nc(e,n,t,function(l,u,h){!r&&!Oi(l,e.chartArea,0)||l.inRange(t.x,t.y,i)&&s.push({element:l,datasetIndex:u,index:h})},!0),s}function XE(e,t,n,i){let r=[];function s(a,l,u){const{startAngle:h,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:m}=zb(a,{x:t.x,y:t.y});Xo(m,h,d)&&r.push({element:a,datasetIndex:l,index:u})}return Nc(e,n,t,s),r}function YE(e,t,n,i,r,s){let a=[];const l=qE(n);let u=Number.POSITIVE_INFINITY;function h(d,m,y){const x=d.inRange(t.x,t.y,r);if(i&&!x)return;const S=d.getCenterPoint(r);if(!(!!s||e.isPointInArea(S))&&!x)return;const T=l(t,S);T<u?(a=[{element:d,datasetIndex:m,index:y}],u=T):T===u&&a.push({element:d,datasetIndex:m,index:y})}return Nc(e,n,t,h),a}function Gh(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?XE(e,t,n,r):YE(e,t,n,i,r,s)}function Lm(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let l=!1;return Nc(e,n,t,(u,h,d)=>{u[a]&&u[a](t[n],r)&&(s.push({element:u,datasetIndex:h,index:d}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var KE={modes:{index(e,t,n,i){const r=xr(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Kh(e,r,s,i,a):Gh(e,r,s,!1,i,a),u=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(h=>{const d=l[0].index,m=h.data[d];m&&!m.skip&&u.push({element:m,datasetIndex:h.index,index:d})}),u):[]},dataset(e,t,n,i){const r=xr(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?Kh(e,r,s,i,a):Gh(e,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,h=e.getDatasetMeta(u).data;l=[];for(let d=0;d<h.length;++d)l.push({element:h[d],datasetIndex:u,index:d})}return l},point(e,t,n,i){const r=xr(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Kh(e,r,s,i,a)},nearest(e,t,n,i){const r=xr(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return Gh(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=xr(t,e);return Lm(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=xr(t,e);return Lm(e,r,"y",n.intersect,i)}}};const hy=["left","top","right","bottom"];function bo(e,t){return e.filter(n=>n.pos===t)}function Im(e,t){return e.filter(n=>hy.indexOf(n.pos)===-1&&n.box.axis===t)}function yo(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function GE(e){const t=[];let n,i,r,s,a,l;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:l=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:l});return t}function JE(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!hy.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function ZE(e,t){const n=JE(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,l;for(s=0,a=e.length;s<a;++s){l=e[s];const{fullSize:u}=l.box,h=n[l.stack],d=h&&l.stackWeight/h.weight;l.horizontal?(l.width=d?d*i:u&&t.availableWidth,l.height=r):(l.width=i,l.height=d?d*r:u&&t.availableHeight)}return n}function QE(e){const t=GE(e),n=yo(t.filter(h=>h.box.fullSize),!0),i=yo(bo(t,"left"),!0),r=yo(bo(t,"right")),s=yo(bo(t,"top"),!0),a=yo(bo(t,"bottom")),l=Im(t,"x"),u=Im(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:bo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Nm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function fy(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 tP(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Lt(r)){n.size&&(e[r]-=n.size);const m=i[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?s.height:s.width),n.size=m.size/m.count,e[r]+=n.size}s.getPadding&&fy(a,s.getPadding());const l=Math.max(0,t.outerWidth-Nm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Nm(a,e,"top","bottom")),h=l!==e.w,d=u!==e.h;return e.w=l,e.h=u,n.horizontal?{same:h,other:d}:{same:d,other:h}}function eP(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function nP(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function ko(e,t,n,i){const r=[];let s,a,l,u,h,d;for(s=0,a=e.length,h=0;s<a;++s){l=e[s],u=l.box,u.update(l.width||t.w,l.height||t.h,nP(l.horizontal,t));const{same:m,other:y}=tP(t,n,l,i);h|=m&&r.length,d=d||y,u.fullSize||r.push(l)}return h&&ko(r,t,n,i)||d}function zl(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function Fm(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const l of e){const u=l.box,h=i[l.stack]||{placed:0,weight:1},d=l.stackWeight/h.weight||1;if(l.horizontal){const m=t.w*d,y=h.size||u.height;qo(h.start)&&(a=h.start),u.fullSize?zl(u,r.left,a,n.outerWidth-r.right-r.left,y):zl(u,t.left+h.placed,a,m,y),h.start=a,h.placed+=m,a=u.bottom}else{const m=t.h*d,y=h.size||u.width;qo(h.start)&&(s=h.start),u.fullSize?zl(u,s,r.top,y,n.outerHeight-r.bottom-r.top):zl(u,s,t.top+h.placed,y,m),h.start=s,h.placed+=m,s=u.right}}t.x=s,t.y=a}var $e={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,i){if(!e)return;const r=Ue(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),l=QE(e.boxes),u=l.vertical,h=l.horizontal;Vt(e.boxes,C=>{typeof C.beforeLayout=="function"&&C.beforeLayout()});const d=u.reduce((C,T)=>T.box.options&&T.box.options.display===!1?C:C+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/d,hBoxMaxHeight:a/2}),y=Object.assign({},r);fy(y,Ue(i));const x=Object.assign({maxPadding:y,w:s,h:a,x:r.left,y:r.top},r),S=ZE(u.concat(h),m);ko(l.fullSize,x,m,S),ko(u,x,m,S),ko(h,x,m,S)&&ko(u,x,m,S),eP(x),Fm(l.leftAndTop,x,m,S),x.x+=x.w,x.y+=x.h,Fm(l.rightAndBottom,x,m,S),e.chartArea={left:x.left,top:x.top,right:x.left+x.w,bottom:x.top+x.h,height:x.h,width:x.w},Vt(l.chartArea,C=>{const T=C.box;Object.assign(T,e.chartArea),T.update(x.w,x.h,{left:0,top:0,right:0,bottom:0})})}};class dy{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class iP extends dy{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const sc="$chartjs",rP={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bm=e=>e===null||e==="";function sP(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[sc]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Bm(r)){const s=wm(e,"width");s!==void 0&&(e.width=s)}if(Bm(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=wm(e,"height");s!==void 0&&(e.height=s)}return e}const py=oE?{passive:!0}:!1;function oP(e,t,n){e&&e.addEventListener(t,n,py)}function aP(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,py)}function lP(e,t){const n=rP[e.type]||e.type,{x:i,y:r}=xr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function _c(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function cP(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||_c(l.addedNodes,i),a=a&&!_c(l.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function uP(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||_c(l.removedNodes,i),a=a&&!_c(l.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const Ko=new Map;let Hm=0;function gy(){const e=window.devicePixelRatio;e!==Hm&&(Hm=e,Ko.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function hP(e,t){Ko.size||window.addEventListener("resize",gy),Ko.set(e,t)}function fP(e){Ko.delete(e),Ko.size||window.removeEventListener("resize",gy)}function dP(e,t,n){const i=e.canvas,r=i&&pd(i);if(!r)return;const s=Ub((l,u)=>{const h=r.clientWidth;n(l,u),h<r.clientWidth&&n()},window),a=new ResizeObserver(l=>{const u=l[0],h=u.contentRect.width,d=u.contentRect.height;h===0&&d===0||s(h,d)});return a.observe(r),hP(e,s),a}function Jh(e,t,n){n&&n.disconnect(),t==="resize"&&fP(e)}function pP(e,t,n){const i=e.canvas,r=Ub(s=>{e.ctx!==null&&n(lP(s,e))},e);return oP(i,t,r),r}class gP extends dy{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(sP(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[sc])return!1;const i=n[sc].initial;["height","width"].forEach(s=>{const a=i[s];Rt(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[sc],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:cP,detach:uP,resize:dP}[n]||pP;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Jh,detach:Jh,resize:Jh}[n]||aP)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return sE(t,n,i,r)}isAttached(t){const n=t&&pd(t);return!!(n&&n.isConnected)}}function mP(e){return!dd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?iP:gP}var Xl;let Ai=(Xl=class{constructor(){ot(this,"x");ot(this,"y");ot(this,"active",!1);ot(this,"options");ot(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return ys(this.x)&&ys(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}},ot(Xl,"defaults",{}),ot(Xl,"defaultRoutes"),Xl);function vP(e,t){const n=e.options.ticks,i=bP(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?_P(t):[],a=s.length,l=s[0],u=s[a-1],h=[];if(a>r)return wP(t,h,s,a/r),h;const d=yP(s,t,r);if(a>0){let m,y;const x=a>1?Math.round((u-l)/(a-1)):null;for(Wl(t,h,d,Rt(x)?0:l-x,l),m=0,y=a-1;m<y;m++)Wl(t,h,d,s[m],s[m+1]);return Wl(t,h,d,u,Rt(x)?t.length:u+x),h}return Wl(t,h,d),h}function bP(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function yP(e,t,n){const i=xP(e),r=t.length/n;if(!i)return Math.max(r,1);const s=lA(i);for(let a=0,l=s.length-1;a<l;a++){const u=s[a];if(u>r)return u}return Math.max(r,1)}function _P(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function wP(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function Wl(e,t,n,i,r){const s=Tt(i,0),a=Math.min(Tt(r,e.length),e.length);let l=0,u,h,d;for(n=Math.ceil(n),r&&(u=r-i,n=u/Math.floor(u/n)),d=s;d<0;)l++,d=Math.round(s+l*n);for(h=Math.max(s,0);h<a;h++)h===d&&(t.push(e[h]),l++,d=Math.round(s+l*n))}function xP(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const SP=e=>e==="left"?"right":e==="right"?"left":e,zm=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Wm=(e,t)=>Math.min(t||e,e);function jm(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function TP(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,l=1e-6;let u=e.getPixelForTick(r),h;if(!(n&&(i===1?h=Math.max(u-s,a-u):t===0?h=(e.getPixelForTick(1)-u)/2:h=(u-e.getPixelForTick(r-1))/2,u+=r<t?h:-h,u<s-l||u>a+l)))return u}function CP(e,t){Vt(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function _o(e){return e.drawTicks?e.tickLength:0}function $m(e,t){if(!e.display)return 0;const n=ke(e.font,t),i=Ue(e.padding);return(ne(e.text)?e.text.length:1)*n.lineHeight+i.height}function OP(e,t){return Ji(e,{scale:t,type:"scale"})}function kP(e,t,n){return Ji(e,{tick:n,index:t,type:"tick"})}function AP(e,t,n){let i=ad(e);return(n&&t!=="right"||!n&&t==="right")&&(i=SP(i)),i}function EP(e,t,n,i){const{top:r,left:s,bottom:a,right:l,chart:u}=e,{chartArea:h,scales:d}=u;let m=0,y,x,S;const C=a-r,T=l-s;if(e.isHorizontal()){if(x=ze(i,s,l),Lt(n)){const A=Object.keys(n)[0],M=n[A];S=d[A].getPixelForValue(M)+C-t}else n==="center"?S=(h.bottom+h.top)/2+C-t:S=zm(e,n,t);y=l-s}else{if(Lt(n)){const A=Object.keys(n)[0],M=n[A];x=d[A].getPixelForValue(M)-T+t}else n==="center"?x=(h.left+h.right)/2-T+t:x=zm(e,n,t);S=ze(i,a,r),m=n==="left"?-me:me}return{titleX:x,titleY:S,maxWidth:y,rotation:m}}class Nr extends Ai{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:i,_suggestedMax:r}=this;return t=yn(t,Number.POSITIVE_INFINITY),n=yn(n,Number.NEGATIVE_INFINITY),i=yn(i,Number.POSITIVE_INFINITY),r=yn(r,Number.NEGATIVE_INFINITY),{min:yn(t,i),max:yn(n,r),minDefined:ue(t),maxDefined:ue(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const l=this.getMatchingVisibleMetas();for(let u=0,h=l.length;u<h;++u)a=l[u].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:yn(n,yn(i,n)),max:yn(i,yn(n,i))}}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(){Gt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=FA(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l<this.ticks.length;this._convertTicksToLabels(u?jm(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=vP(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Gt(this.options.afterUpdate,[this])}beforeSetDimensions(){Gt(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(){Gt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Gt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Gt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Gt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Gt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Gt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=Wm(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,l,u,h;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const d=this._getLabelSizes(),m=d.widest.width,y=d.highest.height,x=Pe(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:x/(i-1),m+6>l&&(l=x/(i-(t.offset?.5:1)),u=this.maxHeight-_o(t.grid)-n.padding-$m(t.title,this.chart.options.font),h=Math.sqrt(m*m+y*y),a=sd(Math.min(Math.asin(Pe((d.highest.height+6)/l,-1,1)),Math.asin(Pe(u/h,-1,1))-Math.asin(Pe(y/h,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Gt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Gt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=$m(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=_o(s)+u):(t.height=this.maxHeight,t.width=_o(s)+u),i.display&&this.ticks.length){const{first:h,last:d,widest:m,highest:y}=this._getLabelSizes(),x=i.padding*2,S=jn(this.labelRotation),C=Math.cos(S),T=Math.sin(S);if(l){const A=i.mirror?0:T*m.width+C*y.height;t.height=Math.min(this.maxHeight,t.height+A+x)}else{const A=i.mirror?0:C*m.width+T*y.height;t.width=Math.min(this.maxWidth,t.width+A+x)}this._calculatePadding(h,d,T,C)}}this._handleMargins(),l?(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,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,h=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,x=0;u?h?(y=r*t.width,x=i*n.height):(y=i*t.height,x=r*n.width):s==="start"?x=n.width:s==="end"?y=t.width:s!=="inner"&&(y=t.width/2,x=n.width/2),this.paddingLeft=Math.max((y-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((x-m+a)*this.width/(this.width-m),0)}else{let d=n.height/2,m=t.height/2;s==="start"?(d=0,m=t.height):s==="end"&&(d=n.height,m=0),this.paddingTop=d+a,this.paddingBottom=m+a}}_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(){Gt(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,i;for(n=0,i=t.length;n<i;n++)Rt(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=jm(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],l=[],u=Math.floor(n/Wm(n,i));let h=0,d=0,m,y,x,S,C,T,A,M,B,D,R;for(m=0;m<n;m+=u){if(S=t[m].label,C=this._resolveTickFontOptions(m),r.font=T=C.string,A=s[T]=s[T]||{data:{},gc:[]},M=C.lineHeight,B=D=0,!Rt(S)&&!ne(S))B=bc(r,A.data,A.gc,B,S),D=M;else if(ne(S))for(y=0,x=S.length;y<x;++y)R=S[y],!Rt(R)&&!ne(R)&&(B=bc(r,A.data,A.gc,B,R),D+=M);a.push(B),l.push(D),h=Math.max(B,h),d=Math.max(D,d)}CP(s,n);const N=a.indexOf(h),I=l.indexOf(d),j=q=>({width:a[q]||0,height:l[q]||0});return{first:j(0),last:j(n-1),widest:j(N),highest:j(I),widths:a,heights:l}}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 fA(this._alignToPixels?br(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 i=n[t];return i.$context||(i.$context=kP(this.getContext(),t,i))}return this.$context||(this.$context=OP(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=jn(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,l=s?s.widest.width+a:0,u=s?s.highest.height+a:0;return this.isHorizontal()?u*i>l*r?l/i:u/r:u*r<l*i?u/i:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,h=this.isHorizontal(),m=this.ticks.length+(u?1:0),y=_o(s),x=[],S=l.setContext(this.getContext()),C=S.display?S.width:0,T=C/2,A=function(it){return br(i,it,C)};let M,B,D,R,N,I,j,q,F,H,U,V;if(a==="top")M=A(this.bottom),I=this.bottom-y,q=M-T,H=A(t.top)+T,V=t.bottom;else if(a==="bottom")M=A(this.top),H=t.top,V=A(t.bottom)-T,I=M+T,q=this.top+y;else if(a==="left")M=A(this.right),N=this.right-y,j=M-T,F=A(t.left)+T,U=t.right;else if(a==="right")M=A(this.left),F=t.left,U=A(t.right)-T,N=M+T,j=this.left+y;else if(n==="x"){if(a==="center")M=A((t.top+t.bottom)/2+.5);else if(Lt(a)){const it=Object.keys(a)[0],K=a[it];M=A(this.chart.scales[it].getPixelForValue(K))}H=t.top,V=t.bottom,I=M+T,q=I+y}else if(n==="y"){if(a==="center")M=A((t.left+t.right)/2);else if(Lt(a)){const it=Object.keys(a)[0],K=a[it];M=A(this.chart.scales[it].getPixelForValue(K))}N=M-T,j=N-y,F=t.left,U=t.right}const st=Tt(r.ticks.maxTicksLimit,m),tt=Math.max(1,Math.ceil(m/st));for(B=0;B<m;B+=tt){const it=this.getContext(B),K=s.setContext(it),ct=l.setContext(it),dt=K.lineWidth,_t=K.color,wt=ct.dash||[],vt=ct.dashOffset,Ft=K.tickWidth,xt=K.tickColor,Ct=K.tickBorderDash||[],Nt=K.tickBorderDashOffset;D=TP(this,B,u),D!==void 0&&(R=br(i,D,dt),h?N=j=F=U=R:I=q=H=V=R,x.push({tx1:N,ty1:I,tx2:j,ty2:q,x1:F,y1:H,x2:U,y2:V,width:dt,color:_t,borderDash:wt,borderDashOffset:vt,tickWidth:Ft,tickColor:xt,tickBorderDash:Ct,tickBorderDashOffset:Nt}))}return this._ticksLength=m,this._borderValue=M,x}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),l=this.ticks,{align:u,crossAlign:h,padding:d,mirror:m}=s,y=_o(i.grid),x=y+d,S=m?-d:x,C=-jn(this.labelRotation),T=[];let A,M,B,D,R,N,I,j,q,F,H,U,V="middle";if(r==="top")N=this.bottom-S,I=this._getXAxisLabelAlignment();else if(r==="bottom")N=this.top+S,I=this._getXAxisLabelAlignment();else if(r==="left"){const tt=this._getYAxisLabelAlignment(y);I=tt.textAlign,R=tt.x}else if(r==="right"){const tt=this._getYAxisLabelAlignment(y);I=tt.textAlign,R=tt.x}else if(n==="x"){if(r==="center")N=(t.top+t.bottom)/2+x;else if(Lt(r)){const tt=Object.keys(r)[0],it=r[tt];N=this.chart.scales[tt].getPixelForValue(it)+x}I=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")R=(t.left+t.right)/2-x;else if(Lt(r)){const tt=Object.keys(r)[0],it=r[tt];R=this.chart.scales[tt].getPixelForValue(it)}I=this._getYAxisLabelAlignment(y).textAlign}n==="y"&&(u==="start"?V="top":u==="end"&&(V="bottom"));const st=this._getLabelSizes();for(A=0,M=l.length;A<M;++A){B=l[A],D=B.label;const tt=s.setContext(this.getContext(A));j=this.getPixelForTick(A)+s.labelOffset,q=this._resolveTickFontOptions(A),F=q.lineHeight,H=ne(D)?D.length:1;const it=H/2,K=tt.color,ct=tt.textStrokeColor,dt=tt.textStrokeWidth;let _t=I;a?(R=j,I==="inner"&&(A===M-1?_t=this.options.reverse?"left":"right":A===0?_t=this.options.reverse?"right":"left":_t="center"),r==="top"?h==="near"||C!==0?U=-H*F+F/2:h==="center"?U=-st.highest.height/2-it*F+F:U=-st.highest.height+F/2:h==="near"||C!==0?U=F/2:h==="center"?U=st.highest.height/2-it*F:U=st.highest.height-H*F,m&&(U*=-1),C!==0&&!tt.showLabelBackdrop&&(R+=F/2*Math.sin(C))):(N=j,U=(1-H)*F/2);let wt;if(tt.showLabelBackdrop){const vt=Ue(tt.backdropPadding),Ft=st.heights[A],xt=st.widths[A];let Ct=U-vt.top,Nt=0-vt.left;switch(V){case"middle":Ct-=Ft/2;break;case"bottom":Ct-=Ft;break}switch(I){case"center":Nt-=xt/2;break;case"right":Nt-=xt;break;case"inner":A===M-1?Nt-=xt:A>0&&(Nt-=xt/2);break}wt={left:Nt,top:Ct,width:xt+vt.width,height:Ft+vt.height,color:tt.backdropColor}}T.push({label:D,font:q,textOffset:U,options:{rotation:C,color:K,strokeColor:ct,strokeWidth:dt,textAlign:_t,textBaseline:V,translation:[R,N],backdrop:wt}})}return T}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-jn(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let h,d;return n==="left"?r?(d=this.right+s,i==="near"?h="left":i==="center"?(h="center",d+=u/2):(h="right",d+=u)):(d=this.right-l,i==="near"?h="right":i==="center"?(h="center",d-=u/2):(h="left",d=this.left)):n==="right"?r?(d=this.left+s,i==="near"?h="right":i==="center"?(h="center",d-=u/2):(h="left",d-=u)):(d=this.left+l,i==="near"?h="left":i==="center"?(h="center",d+=u/2):(h="right",d=this.right)):h="right",{textAlign:h,x:d}}_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:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,h,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(h.x,h.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s<a;++s){const u=r[s];n.drawOnChartArea&&l({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),n.drawTicks&&l({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const l=r.setContext(this.getContext(0)).lineWidth,u=this._borderValue;let h,d,m,y;this.isHorizontal()?(h=br(t,this.left,a)-a/2,d=br(t,this.right,l)+l/2,m=y=u):(m=br(t,this.top,a)-a/2,y=br(t,this.bottom,l)+l/2,h=d=u),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(h,m),n.lineTo(d,y),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Dc(i,r);const s=this.getLabelItems(t);for(const a of s){const l=a.options,u=a.font,h=a.label,d=a.textOffset;Ir(i,h,0,d,u,l)}r&&Lc(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=ke(i.font),a=Ue(i.padding),l=i.align;let u=s.lineHeight/2;n==="bottom"||n==="center"||Lt(n)?(u+=a.bottom,ne(i.text)&&(u+=s.lineHeight*(i.text.length-1))):u+=a.top;const{titleX:h,titleY:d,maxWidth:m,rotation:y}=EP(this,u,n,l);Ir(t,i.text,0,0,s,{color:i.color,maxWidth:m,rotation:y,textAlign:AP(l,n,r),textBaseline:"middle",translation:[h,d]})}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,i=Tt(t.grid&&t.grid.z,-1),r=Tt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Nr.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const l=n[s];l[i]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ke(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class jl{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,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 i;RP(n)&&(i=this.register(n));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,PP(t,a,i),this.override&&ie.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in ie[r]&&(delete ie[r][i],this.override&&delete Lr[i])}}function PP(e,t,n){const i=Vo(Object.create(null),[n?ie.get(n):{},ie.get(t),e.defaults]);ie.set(t,i),e.defaultRoutes&&MP(t,e.defaultRoutes),e.descriptors&&ie.describe(t,e.descriptors)}function MP(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),l=a.pop(),u=a.join(".");ie.route(s,r,u,l)})}function RP(e){return"id"in e&&"defaults"in e}class DP{constructor(){this.controllers=new jl($n,"datasets",!0),this.elements=new jl(Ai,"elements"),this.plugins=new jl(Object,"plugins"),this.scales=new jl(Nr,"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,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Vt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,n,i){const r=rd(t);Gt(i["before"+r],[],i),n[t](i),Gt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var ei=new DP;class LP{constructor(){this._init=[]}notify(t,n,i,r){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,l=a[i],u=[n,r,s.options];if(Gt(l,u,a)===!1&&r.cancelable)return!1}return!0}invalidate(){Rt(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 i=t&&t.config,r=Tt(i.options&&i.options.plugins,{}),s=IP(i);return r===!1&&!n?[]:FP(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function IP(e){const t={},n=[],i=Object.keys(ei.plugins.items);for(let s=0;s<i.length;s++)n.push(ei.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function NP(e,t){return!t&&e===!1?null:e===!0?{}:e}function FP(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const l of t){const u=l.id,h=NP(i[u],r);h!==null&&s.push({plugin:l,options:BP(e.config,{plugin:l,local:n[u]},h,a)})}return s}function BP(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Tf(e,t){const n=ie.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function HP(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function zP(e,t){return e===t?"_index_":"_value_"}function Um(e){if(e==="x"||e==="y"||e==="r")return e}function WP(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Cf(e,...t){if(Um(e))return e;for(const n of t){const i=n.axis||WP(n.position)||e.length>1&&Um(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Vm(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function jP(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Vm(e,"x",n[0])||Vm(e,"y",n[0])}return{}}function $P(e,t){const n=Lr[e.type]||{scales:{}},i=t.scales||{},r=Tf(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Lt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=Cf(a,l,jP(a,e),ie.scales[l.type]),h=zP(u,r),d=n.scales||{};s[a]=No(Object.create(null),[{axis:u},l,d[u],d[h]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,u=a.indexAxis||Tf(l,t),d=(Lr[l]||{}).scales||{};Object.keys(d).forEach(m=>{const y=HP(m,u),x=a[y+"AxisID"]||y;s[x]=s[x]||Object.create(null),No(s[x],[{axis:y},i[x],d[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];No(l,[ie.scales[l.type],ie.scale])}),s}function my(e){const t=e.options||(e.options={});t.plugins=Tt(t.plugins,{}),t.scales=$P(e,t)}function vy(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function UP(e){return e=e||{},e.data=vy(e.data),my(e),e}const qm=new Map,by=new Set;function $l(e,t){let n=qm.get(e);return n||(n=t(),qm.set(e,n),by.add(n)),n}const wo=(e,t,n)=>{const i=Yi(t,n);i!==void 0&&e.add(i)};class VP{constructor(t){this._config=UP(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=vy(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(),my(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $l(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return $l(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return $l(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return $l(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(n);if(l)return l;const u=new Set;n.forEach(d=>{t&&(u.add(t),d.forEach(m=>wo(u,t,m))),d.forEach(m=>wo(u,r,m)),d.forEach(m=>wo(u,Lr[s]||{},m)),d.forEach(m=>wo(u,ie,m)),d.forEach(m=>wo(u,wf,m))});const h=Array.from(u);return h.length===0&&h.push(Object.create(null)),by.has(n)&&a.set(n,h),h}chartOptionScopes(){const{options:t,type:n}=this;return[t,Lr[n]||{},ie.datasets[n]||{},{type:n},ie,wf]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Xm(this._resolverCache,t,r);let u=a;if(XP(a,n)){s.$shared=!1,i=Ki(i)?i():i;const h=this.createResolver(t,i,l);u=_s(a,i,h)}for(const h of n)s[h]=u[h];return s}createResolver(t,n,i=[""],r){const{resolver:s}=Xm(this._resolverCache,t,i);return Lt(n)?_s(s,n,void 0,r):s}}function Xm(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:ud(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const qP=e=>Lt(e)&&Object.getOwnPropertyNames(e).some(t=>Ki(e[t]));function XP(e,t){const{isScriptable:n,isIndexable:i}=Gb(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(Ki(l)||qP(l))||a&&ne(l))return!0}return!1}var YP="4.5.0";const KP=["top","bottom","left","right","chartArea"];function Ym(e,t){return e==="top"||e==="bottom"||KP.indexOf(e)===-1&&t==="x"}function Km(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Gm(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Gt(n&&n.onComplete,[e],t)}function GP(e){const t=e.chart,n=t.options.animation;Gt(n&&n.onProgress,[e],t)}function yy(e){return dd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const oc={},Jm=e=>{const t=yy(e);return Object.values(oc).filter(n=>n.canvas===t).pop()};function JP(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function ZP(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class Jt{static register(...t){ei.add(...t),Zm()}static unregister(...t){ei.remove(...t),Zm()}constructor(t,n){const i=this.config=new VP(n),r=yy(t),s=Jm(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||mP(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,h=u&&u.height,d=u&&u.width;if(this.id=Qk(),this.ctx=l,this.canvas=u,this.width=d,this.height=h,this._options=a,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 LP,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=mA(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],oc[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}wi.listen(this,"complete",Gm),wi.listen(this,"progress",GP),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return Rt(t)?n&&s?s:r?i/r: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 ei}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_m(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vm(this.canvas,this.ctx),this}stop(){return wi.stop(this),this}resize(t,n){wi.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,_m(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Gt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Vt(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const l=n[a],u=Cf(a,l),h=u==="r",d=u==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),Vt(s,a=>{const l=a.options,u=l.id,h=Cf(u,l),d=Tt(l.type,a.dtype);(l.position===void 0||Ym(l.position,h)!==Ym(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===d)m=i[u];else{const y=ei.getScale(d);m=new y({id:u,type:d,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),Vt(r,(a,l)=>{a||delete i[l]}),Vt(i,a=>{$e.configure(this,a,a.options),$e.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Km("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[i];let a=this.getDatasetMeta(i);const l=s.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=l,a.indexAxis=s.indexAxis||Tf(l,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const u=ei.getController(l),{datasetElementType:h,dataElementType:d}=ie.datasets[l];Object.assign(u,{dataElementType:ei.getElement(d),datasetElementType:h&&ei.getElement(h)}),a.controller=new u(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Vt(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 i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,d=this.data.datasets.length;h<d;h++){const{controller:m}=this.getDatasetMeta(h),y=!r&&s.indexOf(m)===-1;m.buildOrUpdateElements(y),a=Math.max(+m.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Vt(s,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Km("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Vt(this.scales,t=>{$e.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!lm(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;JP(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<n;s++)if(!lm(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$e.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Vt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Ki(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(wi.has(this)?this.attached&&!wi.running(this)&&wi.start(this):(this.draw(),Gm({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}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,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[r];(!t||a.visible)&&i.push(a)}return i}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,i={meta:t,index:t.index,cancelable:!0},r=ay(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Dc(n,r),t.controller.draw(),r&&Lc(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Oi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=KE.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={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},i.push(r)),r}getContext(){return this.$context||(this.$context=Ji(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);qo(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r: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(),wi.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(),vm(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete oc[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,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Vt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(u,h)=>{n.addEventListener(this,u,h),t[u]=h},r=(u,h)=>{t[u]&&(n.removeEventListener(this,u,h),delete t[u])},s=(u,h)=>{this.canvas&&this.resize(u,h)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){Vt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Vt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,l,u;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l<u;++l){a=t[l];const h=a&&this.getDatasetMeta(a.datasetIndex).controller;h&&h[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!gc(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(u,h)=>u.filter(d=>!h.some(m=>d.datasetIndex===m.datasetIndex&&d.index===m.index)),a=s(n,t),l=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,l=this._getActiveElements(t,r,i,a),u=sA(t),h=ZP(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Gt(s.onHover,[t,l,this],this),u&&Gt(s.onClick,[t,l,this],this));const d=!gc(l,r);return(d||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=h,d}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}ot(Jt,"defaults",ie),ot(Jt,"instances",oc),ot(Jt,"overrides",Lr),ot(Jt,"registry",ei),ot(Jt,"version",YP),ot(Jt,"getChart",Jm);function Zm(){return Vt(Jt.instances,e=>e._plugins.invalidate())}function QP(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:h,borderJoinStyle:d}=u,m=Math.min(h/a,We(i-n));if(e.beginPath(),e.arc(r,s,a-h/2,i+m/2,n-m/2),l>0){const y=Math.min(h/l,We(i-n));e.arc(r,s,l+h/2,n-y/2,i+y/2,!0)}else{const y=Math.min(h/2,a*We(i-n));if(d==="round")e.arc(r,s,y,n-zt/2,i+zt/2,!0);else if(d==="bevel"){const x=2*y*y,S=-x*Math.cos(n+zt/2)+r,C=-x*Math.sin(n+zt/2)+s,T=x*Math.cos(i+zt/2)+r,A=x*Math.sin(i+zt/2)+s;e.lineTo(S,C),e.lineTo(T,A)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function tM(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let h=r/l;e.beginPath(),e.arc(s,a,l,i-h,n+h),u>r?(h=r/u,e.arc(s,a,u,n+h,i-h,!0)):e.arc(s,a,r,n+me,i-me),e.closePath(),e.clip()}function eM(e){return cd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function nM(e,t,n,i){const r=eM(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),l=u=>{const h=(n-Math.min(s,u))*i/2;return Pe(u,0,Math.min(s,h))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Pe(r.innerStart,0,a),innerEnd:Pe(r.innerEnd,0,a)}}function cs(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function wc(e,t,n,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:h,innerRadius:d}=t,m=Math.max(t.outerRadius+i+n-h,0),y=d>0?d+i+n+h:0;let x=0;const S=r-u;if(i){const tt=d>0?d-i:0,it=m>0?m-i:0,K=(tt+it)/2,ct=K!==0?S*K/(K+i):S;x=(S-ct)/2}const C=Math.max(.001,S*m-n/zt)/m,T=(S-C)/2,A=u+T+x,M=r-T-x,{outerStart:B,outerEnd:D,innerStart:R,innerEnd:N}=nM(t,y,m,M-A),I=m-B,j=m-D,q=A+B/I,F=M-D/j,H=y+R,U=y+N,V=A+R/H,st=M-N/U;if(e.beginPath(),s){const tt=(q+F)/2;if(e.arc(a,l,m,q,tt),e.arc(a,l,m,tt,F),D>0){const dt=cs(j,F,a,l);e.arc(dt.x,dt.y,D,F,M+me)}const it=cs(U,M,a,l);if(e.lineTo(it.x,it.y),N>0){const dt=cs(U,st,a,l);e.arc(dt.x,dt.y,N,M+me,st+Math.PI)}const K=(M-N/y+(A+R/y))/2;if(e.arc(a,l,y,M-N/y,K,!0),e.arc(a,l,y,K,A+R/y,!0),R>0){const dt=cs(H,V,a,l);e.arc(dt.x,dt.y,R,V+Math.PI,A-me)}const ct=cs(I,A,a,l);if(e.lineTo(ct.x,ct.y),B>0){const dt=cs(I,q,a,l);e.arc(dt.x,dt.y,B,A-me,q)}}else{e.moveTo(a,l);const tt=Math.cos(q)*m+a,it=Math.sin(q)*m+l;e.lineTo(tt,it);const K=Math.cos(F)*m+a,ct=Math.sin(F)*m+l;e.lineTo(K,ct)}e.closePath()}function iM(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){wc(e,t,n,i,u,r);for(let h=0;h<s;++h)e.fill();isNaN(l)||(u=a+(l%Qt||Qt))}return wc(e,t,n,i,u,r),e.fill(),u}function rM(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l,options:u}=t,{borderWidth:h,borderJoinStyle:d,borderDash:m,borderDashOffset:y,borderRadius:x}=u,S=u.borderAlign==="inner";if(!h)return;e.setLineDash(m||[]),e.lineDashOffset=y,S?(e.lineWidth=h*2,e.lineJoin=d||"round"):(e.lineWidth=h,e.lineJoin=d||"bevel");let C=t.endAngle;if(s){wc(e,t,n,i,C,r);for(let T=0;T<s;++T)e.stroke();isNaN(l)||(C=a+(l%Qt||Qt))}S&&tM(e,t,C),u.selfJoin&&C-a>=zt&&x===0&&d!=="miter"&&QP(e,t,C),s||(wc(e,t,n,i,C,r),e.stroke())}class Ao extends Ai{constructor(n){super();ot(this,"circumference");ot(this,"endAngle");ot(this,"fullCircles");ot(this,"innerRadius");ot(this,"outerRadius");ot(this,"pixelMargin");ot(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,i,r){const s=this.getProps(["x","y"],r),{angle:a,distance:l}=zb(s,{x:n,y:i}),{startAngle:u,endAngle:h,innerRadius:d,outerRadius:m,circumference:y}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),x=(this.options.spacing+this.options.borderWidth)/2,S=Tt(y,h-u),C=Xo(a,u,h)&&u!==h,T=S>=Qt||C,A=Ti(l,d+x,m+x);return T&&A}getCenterPoint(n){const{x:i,y:r,startAngle:s,endAngle:a,innerRadius:l,outerRadius:u}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:h,spacing:d}=this.options,m=(s+a)/2,y=(l+u+d+h)/2;return{x:i+Math.cos(m)*y,y:r+Math.sin(m)*y}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:r}=this,s=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>Qt?Math.floor(r/Qt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const u=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(u)*s,Math.sin(u)*s);const h=1-Math.sin(Math.min(zt,r||0)),d=s*h;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,iM(n,this,d,a,l),rM(n,this,d,a,l),n.restore()}}ot(Ao,"id","arc"),ot(Ao,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),ot(Ao,"defaultRoutes",{backgroundColor:"backgroundColor"}),ot(Ao,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function _y(e,t,n=t){e.lineCap=Tt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Tt(n.borderDash,t.borderDash)),e.lineDashOffset=Tt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Tt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Tt(n.borderWidth,t.borderWidth),e.strokeStyle=Tt(n.borderColor,t.borderColor)}function sM(e,t,n){e.lineTo(n.x,n.y)}function oM(e){return e.stepped?AA:e.tension||e.cubicInterpolationMode==="monotone"?EA:sM}function wy(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:l}=t,u=Math.max(r,a),h=Math.min(s,l),d=r<a&&s<a||r>l&&s>l;return{count:i,start:u,loop:t.loop,ilen:h<u&&!d?i+h-u:h-u}}function aM(e,t,n,i){const{points:r,options:s}=t,{count:a,start:l,loop:u,ilen:h}=wy(r,n,i),d=oM(s);let{move:m=!0,reverse:y}=i||{},x,S,C;for(x=0;x<=h;++x)S=r[(l+(y?h-x:x))%a],!S.skip&&(m?(e.moveTo(S.x,S.y),m=!1):d(e,C,S,y,s.stepped),C=S);return u&&(S=r[(l+(y?h:0))%a],d(e,C,S,y,s.stepped)),!!u}function lM(e,t,n,i){const r=t.points,{count:s,start:a,ilen:l}=wy(r,n,i),{move:u=!0,reverse:h}=i||{};let d=0,m=0,y,x,S,C,T,A;const M=D=>(a+(h?l-D:D))%s,B=()=>{C!==T&&(e.lineTo(d,T),e.lineTo(d,C),e.lineTo(d,A))};for(u&&(x=r[M(0)],e.moveTo(x.x,x.y)),y=0;y<=l;++y){if(x=r[M(y)],x.skip)continue;const D=x.x,R=x.y,N=D|0;N===S?(R<C?C=R:R>T&&(T=R),d=(m*d+D)/++m):(B(),e.lineTo(D,R),S=N,m=0,C=T=R),A=R}B()}function Of(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?lM:aM}function cM(e){return e.stepped?aE:e.tension||e.cubicInterpolationMode==="monotone"?lE:Sr}function uM(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),_y(e,t.options),e.stroke(r)}function hM(e,t,n,i){const{segments:r,options:s}=t,a=Of(t);for(const l of r)_y(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const fM=typeof Path2D=="function";function dM(e,t,n,i){fM&&!t.options.segment?uM(e,t,n,i):hM(e,t,n,i)}class Ui extends Ai{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;QA(this._points,i,t,r,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=pE(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,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=oy(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=cM(i);let h,d;for(h=0,d=a.length;h<d;++h){const{start:m,end:y}=a[h],x=s[m],S=s[y];if(x===S){l.push(x);continue}const C=Math.abs((r-x[n])/(S[n]-x[n])),T=u(x,S,C,i.stepped);T[n]=t[n],l.push(T)}return l.length===1?l[0]:l}pathSegment(t,n,i){return Of(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=Of(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const l of r)a&=s(t,this,l,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),dM(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ot(Ui,"id","line"),ot(Ui,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ot(Ui,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ot(Ui,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Qm(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class ac extends Ai{constructor(n){super();ot(this,"parsed");ot(this,"skip");ot(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,i,r){const s=this.options,{x:a,y:l}=this.getProps(["x","y"],r);return Math.pow(n-a,2)+Math.pow(i-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,i){return Qm(this,n,"x",i)}inYRange(n,i){return Qm(this,n,"y",i)}getCenterPoint(n){const{x:i,y:r}=this.getProps(["x","y"],n);return{x:i,y:r}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);const r=i&&n.borderWidth||0;return(i+r)*2}draw(n,i){const r=this.options;this.skip||r.radius<.1||!Oi(this,i,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,xf(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ot(ac,"id","point"),ot(ac,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ot(ac,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function xy(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let l,u,h,d,m;return e.horizontal?(m=a/2,l=Math.min(n,r),u=Math.max(n,r),h=i-m,d=i+m):(m=s/2,l=n-m,u=n+m,h=Math.min(i,r),d=Math.max(i,r)),{left:l,top:h,right:u,bottom:d}}function Vi(e,t,n,i){return e?0:Pe(t,n,i)}function pM(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=Kb(i);return{t:Vi(r.top,s.top,0,n),r:Vi(r.right,s.right,0,t),b:Vi(r.bottom,s.bottom,0,n),l:Vi(r.left,s.left,0,t)}}function gM(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Er(r),a=Math.min(t,n),l=e.borderSkipped,u=i||Lt(r);return{topLeft:Vi(!u||l.top||l.left,s.topLeft,0,a),topRight:Vi(!u||l.top||l.right,s.topRight,0,a),bottomLeft:Vi(!u||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:Vi(!u||l.bottom||l.right,s.bottomRight,0,a)}}function mM(e){const t=xy(e),n=t.right-t.left,i=t.bottom-t.top,r=pM(e,n/2,i/2),s=gM(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function Zh(e,t,n,i){const r=t===null,s=n===null,l=e&&!(r&&s)&&xy(e,i);return l&&(r||Ti(t,l.left,l.right))&&(s||Ti(n,l.top,l.bottom))}function vM(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function bM(e,t){e.rect(t.x,t.y,t.w,t.h)}function Qh(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class lc extends Ai{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:i,backgroundColor:r}}=this,{inner:s,outer:a}=mM(this),l=vM(a.radius)?Yo:bM;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),l(t,Qh(a,n,s)),t.clip(),l(t,Qh(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),l(t,Qh(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return Zh(this,t,n,i)}inXRange(t,n){return Zh(this,t,null,n)}inYRange(t,n){return Zh(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}ot(lc,"id","bar"),ot(lc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ot(lc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var yM=Object.freeze({__proto__:null,ArcElement:Ao,BarElement:lc,LineElement:Ui,PointElement:ac});const kf=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],tv=kf.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Sy(e){return kf[e%kf.length]}function Ty(e){return tv[e%tv.length]}function _M(e,t){return e.borderColor=Sy(t),e.backgroundColor=Ty(t),++t}function wM(e,t){return e.backgroundColor=e.data.map(()=>Sy(t++)),t}function xM(e,t){return e.backgroundColor=e.data.map(()=>Ty(t++)),t}function SM(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof Or?t=wM(n,t):r instanceof zo?t=xM(n,t):r&&(t=_M(n,t))}}function ev(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function TM(e){return e&&(e.borderColor||e.backgroundColor)}function CM(){return ie.borderColor!=="rgba(0,0,0,0.1)"||ie.backgroundColor!=="rgba(0,0,0,0.1)"}var OM={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=ev(i)||TM(r)||s&&ev(s)||CM();if(!n.forceOverride&&a)return;const l=SM(e);i.forEach(l)}};function kM(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],l=(n-2)/(s-2);let u=0;const h=t+n-1;let d=t,m,y,x,S,C;for(a[u++]=e[d],m=0;m<s-2;m++){let T=0,A=0,M;const B=Math.floor((m+1)*l)+1+t,D=Math.min(Math.floor((m+2)*l)+1,n)+t,R=D-B;for(M=B;M<D;M++)T+=e[M].x,A+=e[M].y;T/=R,A/=R;const N=Math.floor(m*l)+1+t,I=Math.min(Math.floor((m+1)*l)+1,n)+t,{x:j,y:q}=e[d];for(x=S=-1,M=N;M<I;M++)S=.5*Math.abs((j-T)*(e[M].y-q)-(j-e[M].x)*(A-q)),S>x&&(x=S,y=e[M],C=M);a[u++]=y,d=C}return a[u++]=e[h],a}function AM(e,t,n,i){let r=0,s=0,a,l,u,h,d,m,y,x,S,C;const T=[],A=t+n-1,M=e[t].x,D=e[A].x-M;for(a=t;a<t+n;++a){l=e[a],u=(l.x-M)/D*i,h=l.y;const R=u|0;if(R===d)h<S?(S=h,m=a):h>C&&(C=h,y=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!Rt(m)&&!Rt(y)){const I=Math.min(m,y),j=Math.max(m,y);I!==x&&I!==N&&T.push({...e[I],x:r}),j!==x&&j!==N&&T.push({...e[j],x:r})}a>0&&N!==x&&T.push(e[N]),T.push(l),d=R,s=0,S=C=h,m=y=x=a}}return T}function Cy(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function nv(e){e.data.datasets.forEach(t=>{Cy(t)})}function EM(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:l,minDefined:u,maxDefined:h}=s.getUserBounds();return u&&(i=Pe(Ci(t,s.axis,a).lo,0,n-1)),h?r=Pe(Ci(t,s.axis,l).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var PM={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){nv(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=e.getDatasetMeta(s),h=a||r.data;if(Oo([l,e.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const d=e.scales[u.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:m,count:y}=EM(u,h);const x=n.threshold||4*i;if(y<=x){Cy(r);return}Rt(a)&&(r._data=h,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(C){this._data=C}}));let S;switch(n.algorithm){case"lttb":S=kM(h,m,y,i,n);break;case"min-max":S=AM(h,m,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=S})},destroy(e){nv(e)}};function MM(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const l of i){let{start:u,end:h}=l;h=Fc(u,h,r);const d=Af(n,r[u],r[h],l.loop);if(!t.segments){a.push({source:l,target:d,start:r[u],end:r[h]});continue}const m=oy(t,d);for(const y of m){const x=Af(n,s[y.start],s[y.end],y.loop),S=sy(l,r,x);for(const C of S)a.push({source:C,target:y,start:{[n]:iv(d,x,"start",Math.max)},end:{[n]:iv(d,x,"end",Math.min)}})}}return a}function Af(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=We(r),s=We(s)),{property:e,start:r,end:s}}function RM(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Fc(a,l,r);const u=r[a],h=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:h.x,y:i})):n!==null&&(s.push({x:n,y:u.y}),s.push({x:n,y:h.y}))}),s}function Fc(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function iv(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Oy(e,t){let n=[],i=!1;return ne(e)?(i=!0,n=e):n=RM(e,t),n.length?new Ui({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function rv(e){return e&&e.fill!==!1}function DM(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ue(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function LM(e,t,n){const i=BM(e);if(Lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ue(r)&&Math.floor(r)===r?IM(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function IM(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function NM(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Lt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function FM(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Lt(e)?i=e.value:i=t.getBaseValue(),i}function BM(e){const t=e.options,n=t.fill;let i=Tt(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function HM(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=zM(t,n);l.push(Oy({x:null,y:t.bottom},i));for(let u=0;u<s.length;u++){const h=s[u];for(let d=h.start;d<=h.end;d++)WM(r,a[d],l)}return new Ui({points:r,options:{}})}function zM(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function WM(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:l,point:u}=jM(s,t,"x");if(!(!u||a&&l)){if(a)i.unshift(u);else if(e.push(u),!l)break}}e.push(...i)}function jM(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let l=!1,u=!1;for(let h=0;h<s.length;h++){const d=s[h],m=a[d.start][n],y=a[d.end][n];if(Ti(r,m,y)){l=r===m,u=r===y;break}}return{first:l,last:u,point:i}}class ky{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:Qt},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function $M(e){const{chart:t,fill:n,line:i}=e;if(ue(n))return UM(t,n);if(n==="stack")return HM(e);if(n==="shape")return!0;const r=VM(e);return r instanceof ky?r:Oy(r,i)}function UM(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function VM(e){return(e.scale||{}).getPointPositionForValue?XM(e):qM(e)}function qM(e){const{scale:t={},fill:n}=e,i=NM(n,t);if(ue(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function XM(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=FM(n,t,s),l=[];if(i.grid.circular){const u=t.getPointPositionForValue(0,s);return new ky({x:u.x,y:u.y,radius:t.getDistanceFromCenterForValue(a)})}for(let u=0;u<r;++u)l.push(t.getPointPositionForValue(u,a));return l}function tf(e,t,n){const i=$M(t),{chart:r,index:s,line:a,scale:l,axis:u}=t,h=a.options,d=h.fill,m=h.backgroundColor,{above:y=m,below:x=m}=d||{},S=r.getDatasetMeta(s),C=ay(r,S);i&&a.points.length&&(Dc(e,n),YM(e,{line:a,target:i,above:y,below:x,area:n,scale:l,axis:u,clip:C}),Lc(e))}function YM(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:l,clip:u}=t,h=n._loop?"angle":t.axis;e.save();let d=s;s!==r&&(h==="x"?(sv(e,i,a.top),ef(e,{line:n,target:i,color:r,scale:l,property:h,clip:u}),e.restore(),e.save(),sv(e,i,a.bottom)):h==="y"&&(ov(e,i,a.left),ef(e,{line:n,target:i,color:s,scale:l,property:h,clip:u}),e.restore(),e.save(),ov(e,i,a.right),d=r)),ef(e,{line:n,target:i,color:d,scale:l,property:h,clip:u}),e.restore()}function sv(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:h}=l,d=r[u],m=r[Fc(u,h,r)];s?(e.moveTo(d.x,d.y),s=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(m.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function ov(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const l of i){const{start:u,end:h}=l,d=r[u],m=r[Fc(u,h,r)];s?(e.moveTo(d.x,d.y),s=!1):(e.lineTo(n,d.y),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,l,{move:a}),a?e.closePath():e.lineTo(n,m.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function ef(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:l}=t,u=MM(n,i,r);for(const{source:h,target:d,start:m,end:y}of u){const{style:{backgroundColor:x=s}={}}=h,S=i!==!0;e.save(),e.fillStyle=x,KM(e,a,l,S&&Af(r,m,y)),e.beginPath();const C=!!n.pathSegment(e,h);let T;if(S){C?e.closePath():av(e,i,y,r);const A=!!i.pathSegment(e,d,{move:C,reverse:!0});T=C&&A,T||av(e,i,m,r)}e.closePath(),e.fill(T?"evenodd":"nonzero"),e.restore()}}function KM(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:l}=i||{};if(s==="x"||s==="y"){let u,h,d,m;s==="x"?(u=a,h=r.top,d=l,m=r.bottom):(u=r.left,h=a,d=r.right,m=l),e.beginPath(),n&&(u=Math.max(u,n.left),d=Math.min(d,n.right),h=Math.max(h,n.top),m=Math.min(m,n.bottom)),e.rect(u,h,d-u,m-h),e.clip()}}function av(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var GM={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,l,u;for(a=0;a<i;++a)s=e.getDatasetMeta(a),l=s.dataset,u=null,l&&l.options&&l instanceof Ui&&(u={visible:e.isDatasetVisible(a),index:a,fill:LM(l,a,i),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],!(!u||u.fill===!1)&&(u.fill=DM(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let a=r.length-1;a>=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&tf(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;rv(s)&&tf(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!rv(i)||n.drawTime!=="beforeDatasetDraw"||tf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const lv=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},JM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class cv extends Ai{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,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,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=Gt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,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 i=t.labels,r=ke(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=lv(i,s);let h,d;n.font=r.string,this.isHorizontal()?(h=this.maxWidth,d=this._fitRows(a,s,l,u)+10):(d=this.maxHeight,h=this._fitCols(a,r,l,u)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],h=this.lineWidths=[0],d=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let y=-1,x=-d;return this.legendItems.forEach((S,C)=>{const T=i+n/2+s.measureText(S.text).width;(C===0||h[h.length-1]+T+2*l>a)&&(m+=d,h[h.length-(C>0?0:1)]=0,x+=d,y++),u[C]={left:0,top:x,row:y,width:T,height:r},h[h.length-1]+=T+l}),m}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],h=this.columnSizes=[],d=a-t;let m=l,y=0,x=0,S=0,C=0;return this.legendItems.forEach((T,A)=>{const{itemWidth:M,itemHeight:B}=ZM(i,n,s,T,r);A>0&&x+B+2*l>d&&(m+=y+l,h.push({width:y,height:x}),S+=y+l,C++,y=x=0),u[A]={left:S,top:x,col:C,width:M,height:B},y=Math.max(y,M),x+=B+l}),m+=y,h.push({width:y,height:x}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=fs(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=ze(i,this.left+r,this.right-this.lineWidths[l]);for(const h of n)l!==h.row&&(l=h.row,u=ze(i,this.left+r,this.right-this.lineWidths[l])),h.top+=this.top+t+r,h.left=a.leftForLtr(a.x(u),h.width),u+=h.width+r}else{let l=0,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const h of n)h.col!==l&&(l=h.col,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),h.top=u,h.left+=this.left+r,h.left=a.leftForLtr(a.x(h.left),h.width),u+=h.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Dc(t,this),this._draw(),Lc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=ie.color,u=fs(t.rtl,this.left,this.width),h=ke(a.font),{padding:d}=a,m=h.size,y=m/2;let x;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;const{boxWidth:S,boxHeight:C,itemHeight:T}=lv(a,m),A=function(N,I,j){if(isNaN(S)||S<=0||isNaN(C)||C<0)return;r.save();const q=Tt(j.lineWidth,1);if(r.fillStyle=Tt(j.fillStyle,l),r.lineCap=Tt(j.lineCap,"butt"),r.lineDashOffset=Tt(j.lineDashOffset,0),r.lineJoin=Tt(j.lineJoin,"miter"),r.lineWidth=q,r.strokeStyle=Tt(j.strokeStyle,l),r.setLineDash(Tt(j.lineDash,[])),a.usePointStyle){const F={radius:C*Math.SQRT2/2,pointStyle:j.pointStyle,rotation:j.rotation,borderWidth:q},H=u.xPlus(N,S/2),U=I+y;Yb(r,F,H,U,a.pointStyleWidth&&S)}else{const F=I+Math.max((m-C)/2,0),H=u.leftForLtr(N,S),U=Er(j.borderRadius);r.beginPath(),Object.values(U).some(V=>V!==0)?Yo(r,{x:H,y:F,w:S,h:C,radius:U}):r.rect(H,F,S,C),r.fill(),q!==0&&r.stroke()}r.restore()},M=function(N,I,j){Ir(r,j.text,N,I+T/2,h,{strikethrough:j.hidden,textAlign:u.textAlign(j.textAlign)})},B=this.isHorizontal(),D=this._computeTitleHeight();B?x={x:ze(s,this.left+d,this.right-i[0]),y:this.top+d+D,line:0}:x={x:this.left+d,y:ze(s,this.top+D+d,this.bottom-n[0].height),line:0},ny(this.ctx,t.textDirection);const R=T+d;this.legendItems.forEach((N,I)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const j=r.measureText(N.text).width,q=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),F=S+y+j;let H=x.x,U=x.y;u.setWidth(this.width),B?I>0&&H+F+d>this.right&&(U=x.y+=R,x.line++,H=x.x=ze(s,this.left+d,this.right-i[x.line])):I>0&&U+R>this.bottom&&(H=x.x=H+n[x.line].width+d,x.line++,U=x.y=ze(s,this.top+D+d,this.bottom-n[x.line].height));const V=u.x(H);if(A(V,U,N),H=vA(q,H+S+y,B?H+F:this.right,t.rtl),M(u.x(H),U,N),B)x.x+=F+d;else if(typeof N.text!="string"){const st=h.lineHeight;x.y+=Ay(N,st)+d}else x.y+=R}),iy(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ke(n.font),r=Ue(n.padding);if(!n.display)return;const s=fs(t.rtl,this.left,this.width),a=this.ctx,l=n.position,u=i.size/2,h=r.top+u;let d,m=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),d=this.top+h,m=ze(t.align,m,this.right-y);else{const S=this.columnSizes.reduce((C,T)=>Math.max(C,T.height),0);d=h+ze(t.align,this.top,this.bottom-S-t.labels.padding-this._computeTitleHeight())}const x=ze(l,m,m+y);a.textAlign=s.textAlign(ad(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,Ir(a,n.text,x,d,i)}_computeTitleHeight(){const t=this.options.title,n=ke(t.font),i=Ue(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(Ti(t,this.left,this.right)&&Ti(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],Ti(t,r.left,r.left+r.width)&&Ti(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!eR(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=JM(r,i);r&&!s&&Gt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Gt(n.onHover,[t,i,this],this)}else i&&Gt(n.onClick,[t,i,this],this)}}function ZM(e,t,n,i,r){const s=QM(i,e,t,n),a=tR(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function QM(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function tR(e,t,n){let i=e;return typeof t.text!="string"&&(i=Ay(t,n)),i}function Ay(e,t){const n=e.text?e.text.length:0;return t*n}function eR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var nR={id:"legend",_element:cv,start(e,t,n){const i=e.legend=new cv({ctx:e.ctx,options:n,chart:e});$e.configure(e,i,n),$e.addBox(e,i)},stop(e){$e.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;$e.configure(e,i,n),i.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 i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),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:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(u=>{const h=u.controller.getStyle(n?0:void 0),d=Ue(h.borderWidth);return{text:t[u.index].label,fillStyle:h.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:h.borderColor,pointStyle:i||h.pointStyle,rotation:h.rotation,textAlign:r||h.textAlign,borderRadius:a&&(l||h.borderRadius),datasetIndex:u.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 md extends Ai{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const r=ne(i.text)?i.text.length:1;this._padding=Ue(i.padding);const s=r*ke(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,h,d,m;return this.isHorizontal()?(d=ze(l,i,s),m=n+t,h=s-i):(a.position==="left"?(d=i+t,m=ze(l,r,n),u=zt*-.5):(d=s-t,m=ze(l,n,r),u=zt*.5),h=r-n),{titleX:d,titleY:m,maxWidth:h,rotation:u}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ke(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:h}=this._drawArgs(s);Ir(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:h,textAlign:ad(n.align),textBaseline:"middle",translation:[a,l]})}}function iR(e,t){const n=new md({ctx:e.ctx,options:t,chart:e});$e.configure(e,n,t),$e.addBox(e,n),e.titleBlock=n}var rR={id:"title",_element:md,start(e,t,n){iR(e,n)},stop(e){const t=e.titleBlock;$e.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;$e.configure(e,i,n),i.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=new WeakMap;var sR={id:"subtitle",start(e,t,n){const i=new md({ctx:e.ctx,options:n,chart:e});$e.configure(e,i,n),$e.addBox(e,i),Ul.set(e,i)},stop(e){$e.removeBox(e,Ul.get(e)),Ul.delete(e)},beforeUpdate(e,t,n){const i=Ul.get(e);$e.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eo={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const l=e[t].element;if(l&&l.hasValue()){const u=l.tooltipPosition();i.add(u.x),r+=u.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((l,u)=>l+u)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=e.length;s<a;++s){const u=e[s].element;if(u&&u.hasValue()){const h=u.getCenterPoint(),d=_f(t,h);d<r&&(r=d,l=u)}}if(l){const u=l.tooltipPosition();n=u.x,i=u.y}return{x:n,y:i}}};function ti(e,t){return t&&(ne(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function xi(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e}function oR(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function uv(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:l}=t,u=ke(t.bodyFont),h=ke(t.titleFont),d=ke(t.footerFont),m=s.length,y=r.length,x=i.length,S=Ue(t.padding);let C=S.height,T=0,A=i.reduce((D,R)=>D+R.before.length+R.lines.length+R.after.length,0);if(A+=e.beforeBody.length+e.afterBody.length,m&&(C+=m*h.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),A){const D=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;C+=x*D+(A-x)*u.lineHeight+(A-1)*t.bodySpacing}y&&(C+=t.footerMarginTop+y*d.lineHeight+(y-1)*t.footerSpacing);let M=0;const B=function(D){T=Math.max(T,n.measureText(D).width+M)};return n.save(),n.font=h.string,Vt(e.title,B),n.font=u.string,Vt(e.beforeBody.concat(e.afterBody),B),M=t.displayColors?a+2+t.boxPadding:0,Vt(i,D=>{Vt(D.before,B),Vt(D.lines,B),Vt(D.after,B)}),M=0,n.font=d.string,Vt(e.footer,B),n.restore(),T+=S.width,{width:T,height:C}}function aR(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function lR(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function cR(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:l,right:u}}=e;let h="center";return i==="center"?h=r<=(l+u)/2?"left":"right":r<=s/2?h="left":r>=a-s/2&&(h="right"),lR(h,e,t,n)&&(h="center"),h}function hv(e,t,n){const i=n.yAlign||t.yAlign||aR(e,n);return{xAlign:n.xAlign||t.xAlign||cR(e,t,n,i),yAlign:i}}function uR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function hR(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function fv(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:l,yAlign:u}=n,h=r+s,{topLeft:d,topRight:m,bottomLeft:y,bottomRight:x}=Er(a);let S=uR(t,l);const C=hR(t,u,h);return u==="center"?l==="left"?S+=h:l==="right"&&(S-=h):l==="left"?S-=Math.max(d,y)+r:l==="right"&&(S+=Math.max(m,x)+r),{x:Pe(S,0,i.width-t.width),y:Pe(C,0,i.height-t.height)}}function Vl(e,t,n){const i=Ue(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function dv(e){return ti([],xi(e))}function fR(e,t,n){return Ji(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function pv(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ey={beforeTitle:_i,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:_i,beforeBody:_i,beforeLabel:_i,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 Rt(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:_i,afterBody:_i,beforeFooter:_i,footer:_i,afterFooter:_i};function on(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?Ey[t].call(n,i):r}class Ef extends Ai{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,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new ly(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=fR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=on(i,"beforeTitle",this,t),s=on(i,"title",this,t),a=on(i,"afterTitle",this,t);let l=[];return l=ti(l,xi(r)),l=ti(l,xi(s)),l=ti(l,xi(a)),l}getBeforeBody(t,n){return dv(on(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return Vt(t,s=>{const a={before:[],lines:[],after:[]},l=pv(i,s);ti(a.before,xi(on(l,"beforeLabel",this,s))),ti(a.lines,on(l,"label",this,s)),ti(a.after,xi(on(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return dv(on(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=on(i,"beforeFooter",this,t),s=on(i,"footer",this,t),a=on(i,"afterFooter",this,t);let l=[];return l=ti(l,xi(r)),l=ti(l,xi(s)),l=ti(l,xi(a)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,h;for(u=0,h=n.length;u<h;++u)l.push(oR(this.chart,n[u]));return t.filter&&(l=l.filter((d,m,y)=>t.filter(d,m,y,i))),t.itemSort&&(l=l.sort((d,m)=>t.itemSort(d,m,i))),Vt(l,d=>{const m=pv(t.callbacks,d);r.push(on(m,"labelColor",this,d)),s.push(on(m,"labelPointStyle",this,d)),a.push(on(m,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Eo[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=uv(this,i),h=Object.assign({},l,u),d=hv(this.chart,i,h),m=fv(i,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,s={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:m}=Er(l),{x:y,y:x}=t,{width:S,height:C}=n;let T,A,M,B,D,R;return s==="center"?(D=x+C/2,r==="left"?(T=y,A=T-a,B=D+a,R=D-a):(T=y+S,A=T+a,B=D-a,R=D+a),M=T):(r==="left"?A=y+Math.max(u,d)+a:r==="right"?A=y+S-Math.max(h,m)-a:A=this.caretX,s==="top"?(B=x,D=B-a,T=A-a,M=A+a):(B=x+C,D=B+a,T=A+a,M=A-a),R=B),{x1:T,x2:A,x3:M,y1:B,y2:D,y3:R}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,l,u;if(s){const h=fs(i.rtl,this.x,this.width);for(t.x=Vl(this,i.titleAlign,i),n.textAlign=h.textAlign(i.titleAlign),n.textBaseline="middle",a=ke(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,u=0;u<s;++u)n.fillText(r[u],h.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,u+1===s&&(t.y+=i.titleMarginBottom-l)}}_drawColorBox(t,n,i,r,s){const a=this.labelColors[i],l=this.labelPointStyles[i],{boxHeight:u,boxWidth:h}=s,d=ke(s.bodyFont),m=Vl(this,"left",s),y=r.x(m),x=u<d.lineHeight?(d.lineHeight-u)/2:0,S=n.y+x;if(s.usePointStyle){const C={radius:Math.min(h,u)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},T=r.leftForLtr(y,h)+h/2,A=S+u/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,xf(t,C,T,A),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,xf(t,C,T,A)}else{t.lineWidth=Lt(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const C=r.leftForLtr(y,h),T=r.leftForLtr(r.xPlus(y,1),h-2),A=Er(a.borderRadius);Object.values(A).some(M=>M!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Yo(t,{x:C,y:S,w:h,h:u,radius:A}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Yo(t,{x:T,y:S+1,w:h-2,h:u-2,radius:A}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(C,S,h,u),t.strokeRect(C,S,h,u),t.fillStyle=a.backgroundColor,t.fillRect(T,S+1,h-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:h,boxPadding:d}=i,m=ke(i.bodyFont);let y=m.lineHeight,x=0;const S=fs(i.rtl,this.x,this.width),C=function(j){n.fillText(j,S.x(t.x+x),t.y+y/2),t.y+=y+s},T=S.textAlign(a);let A,M,B,D,R,N,I;for(n.textAlign=a,n.textBaseline="middle",n.font=m.string,t.x=Vl(this,T,i),n.fillStyle=i.bodyColor,Vt(this.beforeBody,C),x=l&&T!=="right"?a==="center"?h/2+d:h+2+d:0,D=0,N=r.length;D<N;++D){for(A=r[D],M=this.labelTextColors[D],n.fillStyle=M,Vt(A.before,C),B=A.lines,l&&B.length&&(this._drawColorBox(n,t,D,S,i),y=Math.max(m.lineHeight,u)),R=0,I=B.length;R<I;++R)C(B[R]),y=m.lineHeight;Vt(A.after,C)}x=0,y=m.lineHeight,Vt(this.afterBody,C),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,l;if(s){const u=fs(i.rtl,this.x,this.width);for(t.x=Vl(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=u.textAlign(i.footerAlign),n.textBaseline="middle",a=ke(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,l=0;l<s;++l)n.fillText(r[l],u.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:l,y:u}=t,{width:h,height:d}=i,{topLeft:m,topRight:y,bottomLeft:x,bottomRight:S}=Er(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+m,u),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(l+h-y,u),n.quadraticCurveTo(l+h,u,l+h,u+y),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(l+h,u+d-S),n.quadraticCurveTo(l+h,u+d,l+h-S,u+d),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(l+x,u+d),n.quadraticCurveTo(l,u+d,l,u+d-x),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(l,u+m),n.quadraticCurveTo(l,u,l+m,u),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=Eo[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=uv(this,t),u=Object.assign({},a,this._size),h=hv(n,t,u),d=fv(t,u,h,n);(r._to!==d.x||s._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ue(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),ny(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),iy(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[u],index:u}}),s=!gc(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),l=this._positionChanged(a,t),u=n||!gc(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),u}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,a=Eo[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}ot(Ef,"positioners",Eo);var dR={id:"tooltip",_element:Ef,positioners:Eo,afterInit(e,t,n){n&&(e.tooltip=new Ef({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:Ey},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"]},pR=Object.freeze({__proto__:null,Colors:OM,Decimation:PM,Filler:GM,Legend:nR,SubTitle:sR,Title:rR,Tooltip:dR});const gR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function mR(e,t,n,i){const r=e.indexOf(t);if(r===-1)return gR(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const vR=(e,t)=>e===null?null:Pe(Math.round(e),0,t);function gv(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Pf extends Nr{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Rt(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:mR(i,t,Tt(n,t),this._addedLabels),vR(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return gv.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}}ot(Pf,"id","category"),ot(Pf,"defaults",{ticks:{callback:gv}});function bR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:h,maxTicks:d,maxDigits:m,includeBounds:y}=e,x=s||1,S=d-1,{min:C,max:T}=t,A=!Rt(a),M=!Rt(l),B=!Rt(h),D=(T-C)/(m+1);let R=um((T-C)/S/x)*x,N,I,j,q;if(R<1e-14&&!A&&!M)return[{value:C},{value:T}];q=Math.ceil(T/R)-Math.floor(C/R),q>S&&(R=um(q*R/S/x)*x),Rt(u)||(N=Math.pow(10,u),R=Math.ceil(R*N)/N),r==="ticks"?(I=Math.floor(C/R)*R,j=Math.ceil(T/R)*R):(I=C,j=T),A&&M&&s&&uA((l-a)/s,R/1e3)?(q=Math.round(Math.min((l-a)/R,d)),R=(l-a)/q,I=a,j=l):B?(I=A?a:I,j=M?l:j,q=h-1,R=(j-I)/q):(q=(j-I)/R,Fo(q,Math.round(q),R/1e3)?q=Math.round(q):q=Math.ceil(q));const F=Math.max(hm(R),hm(I));N=Math.pow(10,Rt(u)?F:u),I=Math.round(I*N)/N,j=Math.round(j*N)/N;let H=0;for(A&&(y&&I!==a?(n.push({value:a}),I<a&&H++,Fo(Math.round((I+H*R)*N)/N,a,mv(a,D,e))&&H++):I<a&&H++);H<q;++H){const U=Math.round((I+H*R)*N)/N;if(M&&U>l)break;n.push({value:U})}return M&&y&&j!==l?n.length&&Fo(n[n.length-1].value,l,mv(l,D,e))?n[n.length-1].value=l:n.push({value:l}):(!M||j===l)&&n.push({value:j}),n}function mv(e,t,{horizontal:n,minRotation:i}){const r=jn(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class xc extends Nr{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 Rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=n?r:u,l=u=>s=i?s:u;if(t){const u=ri(r),h=ri(s);u<0&&h<0?l(0):u>0&&h>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,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},s=this._range||this,a=bR(r,s);return t.bounds==="ticks"&&Hb(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return aa(t,this.chart.options.locale,this.options.ticks.format)}}class Mf extends xc{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ue(t)?t:0,this.max=ue(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jn(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ot(Mf,"id","linear"),ot(Mf,"defaults",{ticks:{callback:Rc.formatters.numeric}});const Go=e=>Math.floor($i(e)),_r=(e,t)=>Math.pow(10,Go(e)+t);function vv(e){return e/Math.pow(10,Go(e))===1}function bv(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function yR(e,t){const n=t-e;let i=Go(n);for(;bv(e,t,i)>10;)i++;for(;bv(e,t,i)<10;)i--;return Math.min(i,Go(e))}function _R(e,{min:t,max:n}){t=yn(e.min,t);const i=[],r=Go(t);let s=yR(t,n),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,h=Math.round((t-u)*a)/a,d=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((h-d)/Math.pow(10,s)),y=yn(e.min,Math.round((u+d+m*Math.pow(10,s))*a)/a);for(;y<n;)i.push({value:y,major:vv(y),significand:m}),m>=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),y=Math.round((u+d+m*Math.pow(10,s))*a)/a;const x=yn(e.max,y);return i.push({value:x,major:vv(x),significand:m}),i}class Rf extends Nr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=xc.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return ue(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ue(t)?Math.max(0,t):null,this.max=ue(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ue(this._userMin)&&(this.min=t===_r(this.min,0)?_r(this.min,-1):_r(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=n?r:l;i===r&&(i<=0?(s(1),a(10)):(s(_r(i,-1)),a(_r(r,1)))),i<=0&&s(_r(r,-1)),r<=0&&a(_r(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=_R(n,this);return t.bounds==="ticks"&&Hb(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":aa(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=$i(t),this._valueRange=$i(this.max)-$i(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:($i(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ot(Rf,"id","logarithmic"),ot(Rf,"defaults",{ticks:{callback:Rc.formatters.logarithmic,major:{enabled:!0}}});function Df(e){const t=e.ticks;if(t.display&&e.display){const n=Ue(t.backdropPadding);return Tt(t.font&&t.font.size,ie.font.size)+n.height}return 0}function wR(e,t,n){return n=ne(n)?n:[n],{w:kA(e,t.string,n),h:n.length*t.lineHeight}}function yv(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function xR(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?zt/s:0;for(let u=0;u<s;u++){const h=a.setContext(e.getPointLabelContext(u));r[u]=h.padding;const d=e.getPointPosition(u,e.drawingArea+r[u],l),m=ke(h.font),y=wR(e.ctx,m,e._pointLabels[u]);i[u]=y;const x=We(e.getIndexAngle(u)+l),S=Math.round(sd(x)),C=yv(S,d.x,y.w,0,180),T=yv(S,d.y,y.h,90,270);SR(n,t,x,C,T)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=OR(e,i,r)}function SR(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,u=0;i.start<t.l?(l=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-l)):i.end>t.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.start<t.t?(u=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-u)):r.end>t.b&&(u=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+u))}function TR(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=n,u=e.getPointPosition(t,i+r+a,s),h=Math.round(sd(We(u.angle+me))),d=ER(u.y,l.h,h),m=kR(h),y=AR(u.x,l.w,m);return{visible:!0,x:u.x,y:d,textAlign:m,left:y,top:d,right:y+l.w,bottom:d+l.h}}function CR(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(Oi({x:n,y:i},t)||Oi({x:n,y:s},t)||Oi({x:r,y:i},t)||Oi({x:r,y:s},t))}function OR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Df(s)/2,additionalAngle:a?zt/r:0};let h;for(let d=0;d<r;d++){u.padding=n[d],u.size=t[d];const m=TR(e,d,u);i.push(m),l==="auto"&&(m.visible=CR(m,h),m.visible&&(h=m))}return i}function kR(e){return e===0||e===180?"center":e<180?"left":"right"}function AR(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function ER(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function PR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!Rt(l)){const u=Er(t.borderRadius),h=Ue(t.backdropPadding);e.fillStyle=l;const d=i-h.left,m=r-h.top,y=s-i+h.width,x=a-r+h.height;Object.values(u).some(S=>S!==0)?(e.beginPath(),Yo(e,{x:d,y:m,w:y,h:x,radius:u}),e.fill()):e.fillRect(d,m,y,x)}}function MR(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));PR(n,a,s);const l=ke(a.font),{x:u,y:h,textAlign:d}=s;Ir(n,e._pointLabels[r],u,h+l.lineHeight/2,l,{color:a.color,textAlign:d,textBaseline:"middle"})}}function Py(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,Qt);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function RR(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:l,lineWidth:u}=t;!a&&!i||!l||!u||n<0||(s.save(),s.strokeStyle=l,s.lineWidth=u,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Py(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function DR(e,t,n){return Ji(e,{label:n,index:t,type:"pointLabel"})}class Po extends xc{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ue(Df(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=ue(t)&&!isNaN(t)?t:0,this.max=ue(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Df(this.options))}generateTickLabels(t){xc.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=Gt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?xR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=Qt/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+jn(i))}getDistanceFromCenterForValue(t){if(Rt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Rt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return DR(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-me+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Py(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let l,u,h;if(n.pointLabels.display&&MR(this,a),r.display&&this.ticks.forEach((d,m)=>{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(d.value);const y=this.getContext(m),x=r.setContext(y),S=s.setContext(y);RR(this,x,u,a,S)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const d=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:y}=d;!y||!m||(t.lineWidth=y,t.strokeStyle=m,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,u=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),h=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!n.reverse)return;const h=i.setContext(this.getContext(u)),d=ke(h.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),h.showLabelBackdrop){t.font=d.string,a=t.measureText(l.label).width,t.fillStyle=h.backdropColor;const m=Ue(h.backdropPadding);t.fillRect(-a/2-m.left,-s-d.size/2-m.top,a+m.width,d.size+m.height)}Ir(t,l.label,0,-s,d,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})}),t.restore()}drawTitle(){}}ot(Po,"id","radialLinear"),ot(Po,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Rc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ot(Po,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ot(Po,"descriptors",{angleLines:{_fallback:"grid"}});const Bc={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}},an=Object.keys(Bc);function _v(e,t){return e-t}function wv(e,t){if(Rt(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ue(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(ys(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function xv(e,t,n,i){const r=an.length;for(let s=an.indexOf(e);s<r-1;++s){const a=Bc[an[s]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(l*a.size))<=i)return an[s]}return an[r-1]}function LR(e,t,n,i,r){for(let s=an.length-1;s>=an.indexOf(n);s--){const a=an[s];if(Bc[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return an[n?an.indexOf(n):0]}function IR(e){for(let t=an.indexOf(e)+1,n=an.length;t<n;++t)if(Bc[an[t]].common)return an[t]}function Sv(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=od(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function NR(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=n[l],u>=0&&(t[u].major=!0);return t}function Tv(e,t,n){const i=[],r={},s=t.length;let a,l;for(a=0;a<s;++a)l=t[a],r[l]=a,i.push({value:l,major:!1});return s===0||!n?i:NR(e,i,r,n)}class Jo extends Nr{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 i=t.time||(t.time={}),r=this._adapter=new UE._date(t.adapters.date);r.init(n),No(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:wv(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:l}=this.getUserBounds();function u(h){!a&&!isNaN(h.min)&&(r=Math.min(r,h.min)),!l&&!isNaN(h.max)&&(s=Math.max(s,h.max))}(!a||!l)&&(u(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&u(this.getMinMax(!1))),r=ue(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=ue(s)&&!isNaN(s)?s:+n.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,l=pA(r,s,a);return this._unit=n.unit||(i.autoSkip?xv(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):LR(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:IR(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Tv(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Pe(n,0,a),i=Pe(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||xv(s.minUnit,n,i,this._getLabelCapacity(n)),l=Tt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,h=ys(u)||u===!0,d={};let m=n,y,x;if(h&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,h?"day":a),t.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const S=r.ticks.source==="data"&&this.getDataTimestamps();for(y=m,x=0;y<i;y=+t.add(y,l,a),x++)Sv(d,y,S);return(y===i||r.bounds==="ticks"||x===1)&&Sv(d,y,S),Object.keys(d).sort(_v).map(C=>+C)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Gt(a,[t,n,i],this);const l=s.time.displayFormats,u=this._unit,h=this._majorUnit,d=u&&l[u],m=h&&l[h],y=i[n],x=h&&m&&y&&y.major;return this._adapter.format(t,r||(x?m:d))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=jn(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),a=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:i*s+l*a,h:i*a+l*s}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,Tv(this,[t],this._majorUnit),r),a=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(wv(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return jb(t.sort(_v))}}ot(Jo,"id","time"),ot(Jo,"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 ql(e,t,n){let i=0,r=e.length-1,s,a,l,u;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=Ci(e,"pos",t)),{pos:s,time:l}=e[i],{pos:a,time:u}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=Ci(e,"time",t)),{time:s,pos:l}=e[i],{time:a,pos:u}=e[r]);const h=a-s;return h?l+(u-l)*(t-s)/h:l}class Lf extends Jo{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=ql(n,this.min),this._tableRange=ql(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,l,u,h,d;for(a=0,l=t.length;a<l;++a)h=t[a],h>=n&&h<=i&&r.push(h);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,l=r.length;a<l;++a)d=r[a+1],u=r[a-1],h=r[a],Math.round((d+u)/2)!==h&&s.push({time:h,pos:a/(l-1)});return s}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ql(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return ql(this._table,i*this._tableRange+this._minPos,!0)}}ot(Lf,"id","timeseries"),ot(Lf,"defaults",Jo.defaults);var FR=Object.freeze({__proto__:null,CategoryScale:Pf,LinearScale:Mf,LogarithmicScale:Rf,RadialLinearScale:Po,TimeScale:Jo,TimeSeriesScale:Lf});const Hc=[$E,yM,pR,FR];class BR{constructor(){this.heartbeatInterval=null,this.offlineTimeout=null,this.lastActivity=Date.now(),this.isOnline=!0,this.init()}init(){this.setupActivityTracking(),this.setupVisibilityHandling(),this.setupBeforeUnload(),this.startHeartbeat()}setupActivityTracking(){["mousedown","mousemove","keypress","scroll","touchstart"].forEach(n=>{document.addEventListener(n,()=>{this.updateActivity()},{passive:!0})})}setupVisibilityHandling(){document.addEventListener("visibilitychange",()=>{document.hidden?this.handleUserAway():this.handleUserBack()})}setupBeforeUnload(){window.addEventListener("beforeunload",()=>{this.setOffline()}),window.addEventListener("pagehide",()=>{this.setOffline()})}updateActivity(){const t=Date.now();t-this.lastActivity>15e3&&(this.lastActivity=t,this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e5),this.notifyLivewireComponents("handleUserActivity"))}handleUserAway(){this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e4)}handleUserBack(){this.lastActivity=Date.now(),this.heartbeat(),this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e5)}startHeartbeat(){this.heartbeatInterval=setInterval(()=>{!document.hidden&&this.isOnline&&this.heartbeat()},3e4)}heartbeat(){this.getActiveGuards().forEach(n=>{var i;fetch("/presence/heartbeat",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":(i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.content},body:JSON.stringify({guard:n})}).then(r=>{r.ok&&(this.isOnline=!0,this.notifyLivewireComponents("handleUserActivity"))}).catch(()=>{})})}setOffline(){if(!this.isOnline)return;this.getActiveGuards().forEach(n=>{var r;const i=JSON.stringify({guard:n});navigator.sendBeacon?navigator.sendBeacon("/presence/offline",i):fetch("/presence/offline",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":(r=document.querySelector('meta[name="csrf-token"]'))==null?void 0:r.content},body:i}).catch(()=>{})}),this.isOnline=!1,this.notifyLivewireComponents("handleUserOffline")}getActiveGuards(){const t=new Set;if(document.querySelectorAll(".user-presence-container").forEach(n=>{const i=n.getAttribute("data-guard")||"web";t.add(i)}),t.size===0){const n=document.body.getAttribute("data-active-guard")||"web";t.add(n)}return Array.from(t)}notifyLivewireComponents(t){document.querySelectorAll("[wire\\:id]").forEach(n=>{const i=n.getAttribute("wire:id");if(i&&n.classList.contains("user-presence-container"))try{Livewire.find(i).call(t)}catch{}})}destroy(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval),this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.setOffline()}}document.addEventListener("DOMContentLoaded",()=>{window.presenceTracker=new BR});window.addEventListener("beforeunload",()=>{window.presenceTracker&&window.presenceTracker.destroy()});Jt.register(...Hc);window.initReturnRatioChart=function(e,t=[]){var s;const n=document.getElementById("returnRatioChart");if(!n||!e||e.length===0)return;const i=e.map(a=>a.return_ratio);Math.min(...i),Math.max(...i);const r=n.getContext("2d");if(r){n.chart&&n.chart.destroy();try{const a=[];t&&t.length>0&&a.push({label:"Trend Line",data:t.map(d=>d.trend_value),borderColor:"#DC2626",backgroundColor:"transparent",borderWidth:3,borderDash:[8,4],tension:0,fill:!1,pointRadius:0,pointHoverRadius:0,order:1}),a.push({label:"Reciprocity Rate %",data:e.map(d=>d.return_ratio),borderColor:"#000",backgroundColor:"rgba(107, 114, 128, 0.1)",borderWidth:3,fill:!0,tension:.4,pointBackgroundColor:"#000",pointBorderColor:"#fff",pointBorderWidth:2,pointRadius:6,pointHoverRadius:8,order:0});const l=((s=e[0])==null?void 0:s.translations)||{period:"Period",return_ratio:"Reciprocity Rate"},u=new Jt(r,{type:"line",data:{labels:e.map(d=>d.label),datasets:a},options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"top",align:"start",labels:{usePointStyle:!0,color:"#1F2937"}},tooltip:{enabled:!1,external:function(d){const m=d.tooltip;let y=document.getElementById("custom-tooltip");if(y||(y=document.createElement("div"),y.id="custom-tooltip",y.style.position="absolute",y.style.background="rgba(0, 0, 0, 0.8)",y.style.color="white",y.style.border="2px solid white",y.style.borderRadius="8px",y.style.pointerEvents="none",y.style.transform="translate(-50%, 0)",y.style.transition="all .1s ease",y.style.padding="10px",y.style.fontSize="12px",y.style.fontFamily="Arial, sans-serif",y.style.zIndex="9999",y.style.boxShadow="none",y.style.outline="none",document.body.appendChild(y)),m.opacity===0){y.style.opacity="0";return}if(m.body){const S=m.title||[],C=m.body.map(A=>A.lines);let T="";S.forEach(function(A){T+='<div style="font-weight: bold; margin-bottom: 5px;">'+A+"</div>"}),C.forEach(function(A,M){const B=m.labelColors[M],D='<span style="display: inline-block; width: 12px; height: 12px; background-color: '+B.backgroundColor+"; border: 1px solid "+B.borderColor+'; margin-right: 5px; vertical-align: middle;"></span>';let R=A[0];M===0?R="Trend: "+R.split(": ")[1]:R="Reciprocity Rate: "+R.split(": ")[1],T+='<div style="margin: 2px 0;">'+D+R+"</div>"}),y.innerHTML=T}const x=d.chart.canvas.getBoundingClientRect();y.style.opacity="1",y.style.left=x.left+window.pageXOffset+m.caretX+"px",y.style.top=x.top+window.pageYOffset+m.caretY+"px"}}},scales:{x:{display:!0,title:{display:!0,text:l.period,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",autoSkip:!1,maxRotation:60,minRotation:60,padding:8,font:{size:10}}},y:{display:!0,title:{display:!0,text:l.return_ratio,color:"#6B7280"},beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",callback:function(d){return Math.round(d)+"%"}}}}}});n.chart=u,window.returnRatioChart=u,n.style.height="300px";const h=document.getElementById("chartLoadingIndicator");return h&&(h.style.display="none"),u}catch{return null}}};document.addEventListener("livewire:init",()=>{Livewire.on("openPdf",n=>{n&&window.open(n,"_blank")});function e(){const n=document.querySelector("[data-chart-data]");if(!n)return;const i=n.getAttribute("data-chart-data"),r=n.getAttribute("data-trend-data");if(i)try{const s=JSON.parse(i),a=r?JSON.parse(r):[];typeof window.initReturnRatioChart=="function"&&window.initReturnRatioChart(s,a)}catch{}}document.addEventListener("DOMContentLoaded",()=>{setTimeout(e,100)});let t=null;Livewire.hook("morph.updated",()=>{clearTimeout(t),t=setTimeout(()=>{e()},300)})});window.exportReturnRatioChartForPdf=async function(){if(!window.returnRatioChart)return null;try{const e=window.returnRatioChart,t=900,n=400,i=document.createElement("canvas");i.width=t,i.height=n;const r=i.getContext("2d"),s=new Jt(r,{type:e.config.type,data:JSON.parse(JSON.stringify(e.config.data)),options:{...JSON.parse(JSON.stringify(e.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1}});await new Promise(l=>setTimeout(l,300));const a=i.toDataURL("image/png",1);return s.destroy(),a}catch{return null}};window.findSingleReportComponent=function(){if(!window.Livewire)return null;const e=document.getElementById("single-report-component");if(e){const n=e.closest("[wire\\:id]");if(n)return window.Livewire.find(n.getAttribute("wire:id"))}const t=document.querySelectorAll("[wire\\:id]");for(let n of t)if(n.querySelector("[data-chart-data]")||n.querySelector("[data-balance-chart-data]")||n.querySelector("#returnRatioChart")||n.querySelector("#accountBalancesChart")||n.querySelector("#account-balances")||n.querySelector("#transaction-types"))return window.Livewire.find(n.getAttribute("wire:id"));return null};window.exportPdfWithChart=async function(){const e=await window.exportReturnRatioChartForPdf();let t=null;window.accountBalancesChart&&(t=await window.exportAccountBalancesChartForPdf());let n=null,i=null;if(window.exportBalanceDistributionChartForPdf&&(n=await window.exportBalanceDistributionChartForPdf("reportBalanceDistributionChart"),i=await window.exportBalanceDistributionChartForPdf("reportBalanceDistributionOrgChart")),!e&&!t&&!n&&!i){if(window.Livewire){const u=window.findSingleReportComponent();u&&u.call("exportPdf")}return}const r=document.querySelector("[data-balance-chart-data]")||document.querySelector("[data-chart-data]");let s=null,a=null,l=!1;if(r){const u=r.getAttribute("data-date-range");if(u){const h=u.split(" to ");h.length===2&&(s=h[0].trim(),a=h[1].trim())}l=r.getAttribute("data-decimal-format")==="1"}if(window.Livewire)try{const u=window.findSingleReportComponent();if(!u)throw new Error("SingleReport Livewire component not found");await u.call("exportPdfWithCharts",e,t,s,a,l,n,i,typeof window.exportNetworkForPdf=="function"?window.exportNetworkForPdf():null)}catch{try{const h=window.findSingleReportComponent();h&&await h.call("exportPdf")}catch{}}};Jt.register(...Hc);window.initAccountBalancesChart=function(e,t){var s;const n=document.getElementById("accountBalancesChart");if(!n||!e||e.length===0)return;const i=n.getContext("2d");if(!i)return;n.chart&&n.chart.destroy();function r(a){if(t){const m=a<0,x=(Math.abs(a)/60).toFixed(2).replace(".",",");return(m?"-":"")+x+" h."}const l=a<0,u=Math.abs(a),h=Math.floor(u/60),d=String(u%60).padStart(2,"0");return"H "+(l?"-":"")+h+":"+d}try{const a=[],l=new Map;e.forEach(S=>{S.accounts&&Array.isArray(S.accounts)&&S.accounts.forEach(C=>{l.has(C.account_id)||l.set(C.account_id,{name:C.account_name,id:C.account_id})})});const u=["#3B82F6","#10B981","#F59E0B","#EF4444"];let h=0;if(l.forEach((S,C)=>{const T=e.map(A=>{var D;const M=(D=A.accounts)==null?void 0:D.find(R=>R.account_id===C);return(M?parseInt(M.balance):0)/60});a.push({label:S.name,data:T,borderColor:u[h%u.length],backgroundColor:u[h%u.length]+"33",borderWidth:3,tension:.4,fill:!0,pointRadius:6,pointHoverRadius:8,pointBackgroundColor:u[h%u.length],pointBorderColor:"#ffffff",pointBorderWidth:2}),h++}),a.length===0)return;const d=e.map(S=>S.label),m=d.length===1?"bar":"line",y=((s=e[0])==null?void 0:s.translations)||{period:"Period",balance:"Balance"},x={type:m,data:{labels:d,datasets:a},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",align:"start",labels:{usePointStyle:!0,color:"#1F2937"}},tooltip:{callbacks:{label:function(S){const C=Math.round(S.parsed.y*60);return S.dataset.label+": "+r(C)}}}},scales:{x:{display:!0,title:{display:!0,text:y.period,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",autoSkip:!1,maxRotation:60,minRotation:60,padding:8,font:{size:10}}},y:{display:!0,title:{display:!0,text:y.balance,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",callback:function(S){const C=Math.round(S*60);return r(C)}}}}}};n.chart=new Jt(i,x),window.accountBalancesChart=n.chart}catch{}};function My(){const e=document.querySelector("[data-balance-chart-data]");if(!e)return;const t=e.getAttribute("data-balance-chart-data");if(t)try{const n=JSON.parse(t),i=e.getAttribute("data-decimal-format")==="1";typeof window.initAccountBalancesChart=="function"&&window.initAccountBalancesChart(n,i)}catch{}}document.addEventListener("DOMContentLoaded",()=>{setTimeout(My,100)});document.addEventListener("livewire:init",()=>{let e=null;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(()=>{My()},300)})});window.exportAccountBalancesChartForPdf=async function(){if(!window.accountBalancesChart)return null;try{const e=window.accountBalancesChart,t=900,n=400,i=document.createElement("canvas");i.width=t,i.height=n;const r=i.getContext("2d"),s=new Jt(r,{type:e.config.type,data:JSON.parse(JSON.stringify(e.config.data)),options:{...JSON.parse(JSON.stringify(e.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1}});await new Promise(l=>setTimeout(l,300));const a=i.toDataURL("image/png",1);return s.destroy(),a}catch{return null}};const Ry=[{key:"volume",canvasId:"statsVolumeChart",dataAttribute:"data-stats-volume-chart",globalName:"statsChartVolume",stacked:!0,dynamicSeries:!0},{key:"registrations",pdfWidth:331,pdfHeight:124,canvasId:"statsRegistrationsChart",dataAttribute:"data-stats-registrations-chart",globalName:"statsChartRegistrations",series:[{field:"User",label:"User"}]},{key:"registrationsOrg",pdfWidth:331,pdfHeight:124,canvasId:"statsRegistrationsOrgChart",dataAttribute:"data-stats-registrations-org-chart",globalName:"statsChartRegistrationsOrg",series:[{field:"Organization",label:"Organization"}]},{key:"inactivations",type:"line",pdfWidth:674,pdfHeight:200,canvasId:"statsInactivationsChart",dataAttribute:"data-stats-inactivations-chart",globalName:"statsChartInactivations",series:[{field:"count",label:"Profiles marked as inactive"},{field:"balance",label:"Total balance",axis:"y1",currency:!0},{field:"incomplete",label:"Incomplete profiles"}],secondAxis:{id:"y1",currency:!0},footerField:"added"},{key:"balance",bandedAxis:!0,pdfWidth:674,pdfHeight:200,canvasId:"statsBalanceChart",dataAttribute:"data-stats-balance-chart",globalName:"statsChartBalance",series:[{field:"User",label:"User"}]},{key:"balanceOrg",bandedAxis:!0,pdfWidth:674,pdfHeight:200,canvasId:"statsBalanceOrgChart",dataAttribute:"data-stats-balance-org-chart",globalName:"statsChartBalanceOrg",series:[{field:"Organization",label:"Organization"}]},{key:"engagementPosts",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementPostsChart",dataAttribute:"data-stats-engagement-posts-chart",globalName:"statsChartEngagementPosts",series:[{field:"posts",label:"Posts"}]},{key:"engagementCalls",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementCallsChart",dataAttribute:"data-stats-engagement-calls-chart",globalName:"statsChartEngagementCalls",series:[{field:"calls",label:"Calls"}]},{key:"engagementReactions",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementReactionsChart",dataAttribute:"data-stats-engagement-reactions-chart",globalName:"statsChartEngagementReactions",series:[{field:"reactions",label:"Reactions"}]},{key:"engagementMessages",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementMessagesChart",dataAttribute:"data-stats-engagement-messages-chart",globalName:"statsChartEngagementMessages",series:[{field:"messages",label:"Messages"}]}],Cv=["#f87171","#4ade80","#60a5fa","#c084fc"],HR=.72;function Dy(e){const t=String(e).replace("#",""),n=t.length===3?t.split("").map(i=>i+i).join(""):t;return/^[0-9a-f]{6}$/i.test(n)?[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]:null}function Ov(e,t=HR){const n=Dy(e);if(!n)return e;const[i,r,s]=n.map(a=>Math.round(a*t));return`rgb(${i}, ${r}, ${s})`}function zR(e,t){const n=Dy(e);if(!n)return e;const[i,r,s]=n;return`rgba(${i}, ${r}, ${s}, ${t})`}function WR(e){const t=getComputedStyle(document.documentElement).getPropertyValue("--color-primary-500").trim();return t?`rgb(${t})`:e}function jR(e){var j,q,F;const t=document.getElementById(e.canvasId);if(!t||typeof window.Chart>"u")return;const n=t.closest(`[${e.dataAttribute}]`);if(!n)return;let i;try{i=JSON.parse(n.getAttribute(e.dataAttribute)||"[]")}catch{return}if(!Array.isArray(i)||i.length===0)return;const r=n.getAttribute("data-decimal-format")==="1",s=`${n.getAttribute(e.dataAttribute)}|${r}`,a=(q=(j=window.Chart).getChart)==null?void 0:q.call(j,t);if(t.dataset.chartSignature===s&&a){window[e.globalName]=a;return}const l=window.Chart.getChart?window.Chart.getChart(t):null;l?l.destroy():typeof((F=window[e.globalName])==null?void 0:F.destroy)=="function"&&window[e.globalName].destroy();const u=e.key==="volume",h=Ov(n.getAttribute("data-chart-color")||WR("rgb(59, 130, 246)")),d=n.getAttribute("data-currency-symbol")||"",m=n.getAttribute("data-currency-position-end")==="1",y=n.getAttribute("data-currency-thousand-separator")||"",x=H=>y?String(H).replace(/\B(?=(\d{3})+(?!\d))/g,y):String(H),S=H=>d?m?`${H} ${d}`:`${d} ${H}`:H,C=(H,U=!1)=>{if(r)return S(`${H.toFixed(2).replace(".",",")} h.`);const V=H<0,st=Math.abs(H),tt=Math.floor(st),it=Math.round((st-tt)*60),K=it===60?tt+1:tt,ct=it===60?0:it,dt=V?"-":"",_t=x(K);return S(U&&ct===0?`${dt}${_t}`:`${dt}${_t}:${String(ct).padStart(2,"0")}`)};let T={},A={};try{T=JSON.parse(n.getAttribute("data-series-labels")||"{}"),A=JSON.parse(n.getAttribute("data-series-colors")||"{}")}catch{T={},A={}}const M=e.type||"bar",B=M==="line",D=e.dynamicSeries?Object.keys(i[0]||{}).filter(H=>!["label","ym","count","volume"].includes(H)).map(H=>({field:H,label:H})):e.series,R=!e.secondAxis||(D||[]).some(H=>H.axis===e.secondAxis.id&&i.some(U=>Number(U[H.field])!==0)),N=(D||[]).filter(H=>R||!e.secondAxis||H.axis!==e.secondAxis.id),I=D?N.map((H,U)=>{const V=A[H.field]||Cv[U%Cv.length],st=Ov(V);return{label:T[H.field]||H.label,data:i.map(tt=>tt[H.field]||0),backgroundColor:B?zR(V,.15):st,borderColor:st,borderWidth:B?2:1,...B?{tension:e.stepLike===!0?0:.3,pointRadius:0,pointHoverRadius:4,fill:!1}:{},...H.axis?{yAxisID:H.axis}:{},...H.dashed?{borderDash:[6,4]}:{}}}):[{label:u?"volume":"count",data:i.map(H=>u?(H.volume||0)/60:H.count||0),backgroundColor:h,borderColor:h,borderWidth:1}];window[e.globalName]=new window.Chart(t.getContext("2d"),{type:M,data:{labels:i.map(H=>H.label),datasets:I},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{bottom:16}},plugins:{legend:I.length>1?{display:!0,position:"bottom",align:"start",labels:{boxWidth:12,usePointStyle:!0,padding:16}}:{display:!1},tooltip:{mode:e.stacked===!0?"index":"nearest",intersect:e.stacked!==!0,callbacks:{title:H=>{var V,st;const U=i[(V=H[0])==null?void 0:V.dataIndex];return(U==null?void 0:U.range)||((st=H[0])==null?void 0:st.label)||""},label:H=>{const U=H.parsed.y,V=N==null?void 0:N[H.datasetIndex],tt=u||(V==null?void 0:V.currency)===!0?C(U):`${U}`;return I.length>1?`${H.dataset.label}: ${tt}`:tt},footer:H=>{if(H.length===0)return;if(e.footerField){const V=i[H[0].dataIndex],st=(V==null?void 0:V[e.footerField])||0,tt=n.getAttribute("data-footer-label");return tt?`${tt}: +${st}`:`+${st}`}if(e.stacked!==!0)return;const U=H.reduce((V,st)=>V+(st.parsed.y||0),0);return`∑ ${u?C(U):U}`}}}},scales:{y:{beginAtZero:!0,stacked:e.stacked===!0,ticks:u?{callback:H=>C(H,!0)}:{precision:0}},...e.secondAxis&&R?{[e.secondAxis.id]:{position:"right",beginAtZero:!0,grid:{drawOnChartArea:!1},ticks:e.secondAxis.currency?{callback:H=>C(H,!0)}:{precision:0}}}:{},x:{stacked:e.stacked===!0,grid:{display:!0,drawOnChartArea:!0,offset:e.bandedAxis!==!0,color:"rgba(0, 0, 0, 0.10)"},ticks:{padding:8,autoSkip:!1,maxRotation:60,minRotation:60,font:{size:10}}}}}}),t.dataset.chartSignature=s}function Ly(){Ry.forEach(e=>{try{jR(e)}catch(t){console.error(`[stats-charts] ${e.canvasId} failed to render:`,t)}})}document.addEventListener("DOMContentLoaded",()=>{setTimeout(Ly,100)});document.addEventListener("livewire:init",()=>{let e=null;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(Ly,300)}),Livewire.on("openStatsPdf",t=>{window.open(Array.isArray(t)?t[0]:t,"_blank")})});async function $R(e){var i,r;const t=document.getElementById(e.canvasId),n=t&&((r=(i=window.Chart).getChart)==null?void 0:r.call(i,t))||window[e.globalName];if(!n)return null;try{const a=e.pdfWidth||674,l=e.pdfHeight||180,u=document.createElement("canvas");u.width=a*2,u.height=l*2;const h=JSON.parse(JSON.stringify({type:n.config.type,data:n.config.data,options:n.config.options}));h.options={...h.options,responsive:!1,maintainAspectRatio:!1,animation:!1,devicePixelRatio:2};const d=new window.Chart(u.getContext("2d"),h);await new Promise(y=>setTimeout(y,300));const m=u.toDataURL("image/png",1);return d.destroy(),m}catch{return null}}function UR(){if(!window.Livewire)return null;const e=document.getElementById("stats-component"),t=e?e.closest("[wire\\:id]")||e:null;return t&&t.getAttribute("wire:id")?window.Livewire.find(t.getAttribute("wire:id")):null}window.exportStatsPdf=async function(){const e=UR();if(!e)return;const t={};for(const i of Ry){const r=await $R(i);r&&(t[i.key]=r)}if(typeof window.exportNetworkForPdf=="function"){const i=window.exportNetworkForPdf();i&&(t.network=i)}const n=document.querySelector("[data-network-host]");n&&n.dataset.networkSubtext&&(t.networkSubtext=n.dataset.networkSubtext);try{await e.call("exportPdf",t)}catch{try{await e.call("exportPdf",{})}catch{}}};const nf=16,VR=8;class ds{constructor(t){this.deltas=t||[],this.checkpoints=new Map,this.recent=new Map;const n=new Set,i=new Set;this.deltas.forEach((r,s)=>{ds.apply(n,i,r),s%nf===0&&this.checkpoints.set(s,{nodes:new Set(n),edges:new Set(i)})})}static apply(t,n,i){(i.nodes_removed||[]).forEach(r=>t.delete(r)),(i.nodes_added||[]).forEach(r=>t.add(r)),(i.edges_removed||[]).forEach(r=>n.delete(r)),(i.edges_added||[]).forEach(r=>n.add(r))}get length(){return this.deltas.length}at(t){if(t<0||t>=this.deltas.length)return null;if(this.recent.has(t))return this.recent.get(t);let n;if(this.checkpoints.has(t))n=this.checkpoints.get(t);else{const i=this.recent.has(t-1)?t-1:Math.floor(t/nf)*nf,r=this.recent.get(i)||this.checkpoints.get(i),s=new Set(r.nodes),a=new Set(r.edges);for(let l=i+1;l<=t;l++)ds.apply(s,a,this.deltas[l]);n={nodes:s,edges:a}}return this.recent.set(t,n),this.recent.size>VR&&this.recent.delete(this.recent.keys().next().value),n}}function qR(e){const t=e&&e.frames||[],n=new ds(t),i=e&&e.ghosts?new ds(e.ghosts):null,r=e&&e.history?new ds(e.history):null;return{count:t.length,step:s=>t[s]?{label:t[s].label,till:t[s].till}:null,layers:s=>({current:n.at(s),ghost:i?i.at(s):null,back:r?r.at(s):null})}}const kv=new WeakMap;function ni(e){if(e&&e.nodes instanceof Set)return e;let t=kv.get(e);return t||(t={nodes:new Set((e.nodes||[]).map(n=>n.id)),edges:new Set((e.edges||[]).map(n=>typeof n=="string"?n:`${n.source}|${n.target}|${n.type_id}`))},kv.set(e,t)),t}function XR(e){zc(e)}function zc(e){let t=e.scratch("_timelapseIndex");return t||(t={nodes:new Map,edges:new Map},e.nodes().forEach(n=>t.nodes.set(n.id(),n)),e.edges().forEach(n=>{const i=n.data("key");t.edges.has(i)||t.edges.set(i,[]),t.edges.get(i).push(n)}),e.scratch("_timelapseIndex",t)),t}function Zo(e,t,n=t?1:0){const i=e.scratch("_timelapse")||{};i.shown!==t&&(e.style("display",t?"element":"none"),i.shown=t),i.opacity!==n&&(e.style("opacity",n),i.opacity=n),e.scratch("_timelapse",i)}const YR=.5;function Iy(e,t){if(!Number.isFinite(t))return;const n=e.data("size");(!Number.isFinite(n)||Math.abs(n-t)>=YR)&&e.data("size",t)}const KR=.25,GR=.15,If={current:1,ghost:KR,history:GR,hidden:0};function JR(e){let t,n,i;const r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(String(e||"").trim());if(r){const l=r[1].length===3?r[1].split("").map(u=>u+u).join(""):r[1];t=parseInt(l.slice(0,2),16),n=parseInt(l.slice(2,4),16),i=parseInt(l.slice(4,6),16)}else{const l=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(String(e||""));if(!l)return"#94a3b8";[t,n,i]=l.slice(1,4).map(Number)}const a=Math.round(.2126*t+.7152*n+.0722*i).toString(16).padStart(2,"0");return`#${a}${a}${a}`}function vd(e,t){const n=e.scratch("_timelapse")||{},i=t==="ghost"||t==="history";if(n.tier===t){i&&e.data("ghostColor")!==n.grey&&e.data("ghostColor",n.grey);return}const r=n.tier==="ghost"||n.tier==="history";i&&!r?(n.grey=JR(bd(e)),e.data("ghostColor",n.grey)):i&&e.data("ghostColor")!==n.grey&&e.data("ghostColor",n.grey),t!=="hidden"&&(e.toggleClass("ghost",i),e.toggleClass("history",t==="history")),n.tier=t,e.scratch("_timelapse",n)}function Ny(e){const t=e.scratch("_timelapse")||{};e.removeClass("ghost history"),t.tier="hidden",e.scratch("_timelapse",t)}function Sc(e,t,n,i){return t.has(e)?"current":n&&n.has(e)?"ghost":i&&i.has(e)?"history":"hidden"}function Nf(e,t,n=null){const i=ni(t.current),r=t.ghost?ni(t.ghost):null,s=t.back?ni(t.back):null,a=(l,u)=>{if(u==="hidden"){Zo(l,!1),Ny(l);return}vd(l,u),Zo(l,!0,If[u])};e.batch(()=>{e.nodes().forEach(l=>{const u=l.id();a(l,Sc(u,i.nodes,r&&r.nodes,s&&s.nodes)),n&&(l.scratch("_timelapse")||{}).shown&&Iy(l,n(u))}),e.edges().forEach(l=>{const u=l.data("key");a(l,Sc(u,i.edges,r&&r.edges,s&&s.edges))})})}function ZR(e,t,n){const i={current:ni(t.current),ghost:t.ghost?ni(t.ghost):null,back:t.back?ni(t.back):null},r={current:ni(n.current),ghost:n.ghost?ni(n.ghost):null,back:n.back?ni(n.back):null},s=zc(e),a=[],l=[],u=[],h=(d,m,y)=>{if(d==="nodes"){const x=s.nodes.get(m);x&&y(x)}else(s.edges.get(m)||[]).forEach(y)};return e.batch(()=>{["nodes","edges"].forEach(d=>{const m=C=>C?C[d]:null,y=new Set;[r.current,i.current,r.ghost,i.ghost].forEach(C=>{C&&C[d].forEach(T=>y.add(T))});const x=m(i.back),S=m(r.back);S&&S.forEach(C=>{(!x||!x.has(C))&&y.add(C)}),x&&x.forEach(C=>{(!S||!S.has(C))&&y.add(C)}),y.forEach(C=>{const T=Sc(C,i.current[d],m(i.ghost),x),A=Sc(C,r.current[d],m(r.ghost),S);if(T===A)return;const M=If[T],B=If[A];h(d,C,D=>{const R=D.scratch("_timelapse")||{},N=R.shown?R.opacity:0,I={element:D,from:N,to:B,colorFrom:null,colorTo:null,tierAtEnd:null};if(A!=="hidden"){const j=tD(D),q=A==="ghost"||A==="history";q||!D.hasClass("ghost")?vd(D,A):I.tierAtEnd=A;const F=q?(D.scratch("_timelapse")||{}).grey:bd(D);D.hasClass("ghost")&&j!==F&&(D.data("ghostColor",j),I.colorFrom=j,I.colorTo=F)}Zo(D,!0,N),B>M?a.push(I):(l.push(I),A==="hidden"&&u.push(I))})})})}),{cy:e,arriving:a,departing:l,expiring:u}}function QR(e,t,n=null){const i=zc(e),r=new Map,s=new Map,a=[],l=(y,x,S,C)=>{let T=y.get(x);T||(T={steps:[],values:[]},y.set(x,T)),T.steps[T.steps.length-1]===S?T.values[T.values.length-1]=C:(T.steps.push(S),T.values.push(C))},u=new Set,h=new Set,d=new Map;for(let y=0;y<t.count;y++){const x=new Set,S=t.layers(y);(y===0?[S.current,S.ghost,S.back]:[S.current]).forEach(A=>{A&&ni(A).edges.forEach(M=>{u.has(M)||(u.add(M),(i.edges.get(M)||[]).forEach(B=>{const D=B.source().id(),R=B.target().id(),N=D<R?`${D}|${R}`:`${R}|${D}`;h.has(N)||(h.add(N),[D,R].forEach(I=>{const j=(d.get(I)||0)+1;d.set(I,j),l(r,I,y,j),x.add(I)}))}))})});const T=n?n[y]:null;T&&Object.keys(T).forEach(A=>{l(s,A,y,Number(T[A])||0),x.add(A)}),a.push([...x])}const m=(y,x,S)=>{const C=y.get(x);if(!C||C.steps[0]>S)return 0;let T=0,A=C.steps.length-1;for(;T<A;){const M=T+A+1>>1;C.steps[M]<=S?T=M:A=M-1}return C.values[T]};return{degreeAt:(y,x)=>m(r,y,x),volumeAt:(y,x)=>m(s,y,x),changedAt:y=>a[y]||[]}}function Fy(e,t){Zo(e.element,!0,t>=1?e.to:e.from+(e.to-e.from)*t),e.colorFrom&&e.element.data("ghostColor",eD(e.colorFrom,e.colorTo,t))}function Av(e){const{element:t}=e;Fy(e,1),e.tierAtEnd&&vd(t,e.tierAtEnd),e.to===0&&(Zo(t,!1),Ny(t))}function bd(e){return e.isNode()?e.data("color"):e.data("edgeColor")||"#64748b"}function tD(e){return e.hasClass("ghost")?e.data("ghostColor"):bd(e)}function Ev(e){const t=String(e||"").trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){const r=n[1].length===3?n[1].split("").map(s=>s+s).join(""):n[1];return[0,2,4].map(s=>parseInt(r.slice(s,s+2),16))}const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(t);return i?i.slice(1,4).map(Number):null}function eD(e,t,n){const i=Ev(e),r=Ev(t);return!i||!r?n<.5?e:t:"#"+i.map((s,a)=>Math.round(s+(r[a]-s)*n).toString(16).padStart(2,"0")).join("")}function nD(e){const t=new Map;return{add(n,i,r){[...n.arriving,...n.departing].forEach(s=>{t.set(s.element,{item:s,start:i,duration:r})})},tick(n){return t.size===0?!1:(e.batch(()=>{t.forEach(({item:i,start:r,duration:s},a)=>{const l=Math.min(1,(n-r)/s);l>=1?(Av(i),t.delete(a)):Fy(i,l*l*(3-2*l))})}),t.size>0)},settle(){e.batch(()=>t.forEach(({item:n})=>Av(n))),t.clear()},clear(){t.clear()}}}const iD=450,rD=4;function Pv(e){return Math.max(e,Math.min(iD,e*rD))}function sD({cy:e,count:t,layersAt:n,interval:i=450,onFrame:r=null,sizeOf:s=null,changedAt:a=null,holdAtEnd:l=3e3,loop:u=!0}){let h=i,d=0,m=null,y=!1,x=0;const S=nD(e),C=()=>{r&&r(d)},T=D=>{S.clear(),d=Math.max(0,Math.min(D,t-1)),Nf(e,n(d),s?R=>s(R,d):null),C()},A=D=>{if(!s||!a)return;const R=zc(e).nodes;e.batch(()=>{a(D).forEach(N=>{const I=R.get(N);I&&Iy(I,s(N,D))})})},M=D=>{if(m=null,y&&D>=x)if(d>=t-1)u?(T(0),x=D+h):(y=!1,C());else{const N=ZR(e,n(d),n(d+1));d+=1,A(d),C(),S.add(N,D,Pv(h)),x=Math.max(x+h,D),d>=t-1&&(x=D+Pv(h)+l)}const R=S.tick(D);(y||R)&&(m=requestAnimationFrame(M))},B=()=>{m===null&&(m=requestAnimationFrame(M))};return{play(){y||t===0||(y=!0,d>=t-1&&T(0),x=performance.now(),B())},pause:()=>{y=!1},isPlaying:()=>y,setInterval:D=>{h=Math.max(16,D)},goTo:D=>{y=!1,T(D)},currentIndex:()=>d}}const oD=2e3;function aD({screenBox:e,frameBox:t,headerBox:n,button:i,panel:r,signal:s,onResize:a}){if(!e||!t||!i)return;const l=e.requestFullscreen||e.webkitRequestFullscreen,u=document.exitFullscreen||document.webkitExitFullscreen;if(!l||!u){i.hidden=!0;return}const h=()=>document.fullscreenElement||document.webkitFullscreenElement||null,d={capture:!0,passive:!0,signal:s};let m=null,y="mouse",x=!1,S=null;const C=D=>{if(!D||!S)return!1;const R=D.getBoundingClientRect();return S.x>=R.left&&S.x<=R.right&&S.y>=R.top&&S.y<=R.bottom},T=()=>x?!0:y==="mouse"&&[n,r?r():null].some(C),A=()=>{clearTimeout(m),m=setTimeout(()=>{if(h()===e){if(T()){A();return}e.classList.add("controls-hidden")}},oD)},M=()=>{h()===e&&(e.classList.remove("controls-hidden"),A())};["pointermove","mousemove","pointerdown","touchstart","wheel","keydown"].forEach(D=>{document.addEventListener(D,M,d)}),s&&s.addEventListener("abort",()=>clearTimeout(m),{once:!0}),e.addEventListener("pointerdown",D=>{x=!0,y=D.pointerType||"mouse",S={x:D.clientX,y:D.clientY}},d),e.addEventListener("pointermove",D=>{y=D.pointerType||y,S={x:D.clientX,y:D.clientY}},d),e.addEventListener("pointerleave",()=>{S=null},{signal:s}),["pointerup","pointercancel"].forEach(D=>{document.addEventListener(D,()=>{x&&(x=!1,M())},d)}),i.addEventListener("click",D=>{D.preventDefault();const R=h()===e?u.call(document):l.call(e);R&&typeof R.catch=="function"&&R.catch(()=>{})},{signal:s});const B=()=>{var N,I;const D=h()===e,R=D?i.dataset.labelExit:i.dataset.labelEnter;i.setAttribute("title",R),i.setAttribute("aria-label",R),(N=i.querySelector("[data-fullscreen-enter]"))==null||N.classList.toggle("hidden",D),(I=i.querySelector("[data-fullscreen-exit]"))==null||I.classList.toggle("hidden",!D),e.classList.remove("controls-hidden"),clearTimeout(m),D&&A(),a&&requestAnimationFrame(()=>a(D,n?n.offsetHeight:0))};document.addEventListener("fullscreenchange",B,{signal:s}),document.addEventListener("webkitfullscreenchange",B,{signal:s})}const Ff="data-stats-network";let rf=null;function lD(){return rf||(rf=Promise.all([af(()=>import("./cytoscape.esm-B5_a_fx8.js"),[]),af(()=>import("./cytoscape-fcose-Di-e6ZnW.js").then(e=>e.c),__vite__mapDeps([0,1]))]).then(([e,t])=>{const n=e.default||e;return n.use(t.default||t),n})),rf}const cD={User:"#14b8a6",Organization:"#d946ef",Bank:"#f59e0b"};function Tc(e,t){return t?6+Math.pow(e/t,.85)*36:8}const Mv={1:"#1e293b",2:"#4338ca",3:"#16a34a",4:"#eab308",5:"#ff3b00",6:"#0891b2"},By={flowing:"#3b82f6",stalled:"#9333ea",neverPaid:"#22d3ee"};function uD(e,t,n=null,i=!1){const r=new Map,s=(u,h)=>r.set(u,(r.get(u)||0)+h),a=new Set(e.map(u=>u.id));(t||[]).forEach(u=>{const h=a.has(u.source),d=a.has(u.target),m=u.a_to_b||0,y=u.b_to_a||0;m>0&&(h&&s(u.source,-m),d&&s(u.target,m)),y>0&&(d&&s(u.target,-y),h&&s(u.source,y))});const l=new Map;return e.forEach(u=>{const h=r.get(u.id)||0,d=u.days_since_paid;if(d==null){l.set(u.id,{flow:"neverPaid",net:h});return}const m=i&&u.inactive||n!==null&&d>n;l.set(u.id,{flow:m?"stalled":"flowing",net:h})}),l}const Cc=["#3b82f6","#f97316","#14b8a6","#d946ef","#84cc16","#8b5cf6","#ec4899","#22c55e","#0ea5e9","#eab308"];function hD(e){const t=[];e.forEach(i=>{i.region&&!t.includes(i.region)&&t.push(i.region)});const n={};return t.forEach((i,r)=>{n[i]=Cc[r%Cc.length]}),n}const Bf={force:{name:"fcose",quality:"default",animate:!1,randomize:!0,nodeRepulsion:6e3,idealEdgeLength:60},circle:{name:"circle",animate:!1,padding:30,avoidOverlap:!0},concentric:{name:"concentric",animate:!1,padding:30,minNodeSpacing:14,concentric:e=>e.degree(),levelWidth:e=>Math.max(1,e.maxDegree()/6)},tree:{name:"breadthfirst",animate:!1,padding:30,spacingFactor:1.1,directed:!1,circle:!1,grid:!0},grid:{name:"grid",animate:!1,padding:30,avoidOverlap:!0}};function Rv(e,t){const n=Bf[e]||Bf.force;if(n.name!=="breadthfirst")return n;const i=mD(t);return i?{...n,roots:i}:n}let zi,fD=0;const Mo=new Map;function Hy(){if(zi!==void 0)return zi;try{zi=new Worker(new URL("/build/assets/network-layout-worker-BKWU_04t.js",import.meta.url)),zi.onmessage=e=>{const{id:t,positions:n,error:i}=e.data||{},r=Mo.get(t);r&&(Mo.delete(t),i?r.reject(new Error(i)):r.resolve(n))},zi.onerror=e=>{const t=new Error(e&&e.message||"layout worker failed");Mo.forEach(n=>n.reject(t)),Mo.clear(),zi=null}}catch(e){console.error("[network] no layout worker, laying out on the page instead",e),zi=null}return zi}function dD(e,t){const n=Hy();if(!n)return Promise.reject(new Error("no layout worker"));const i=e.nodes().map(l=>({id:l.id(),size:l.data("size")})),r=new Set(i.map(l=>l.id)),s=e.edges().filter(l=>r.has(l.source().id())&&r.has(l.target().id())).map(l=>({id:l.id(),source:l.source().id(),target:l.target().id()})),a=++fD;return new Promise((l,u)=>{Mo.set(a,{resolve:l,reject:u}),n.postMessage({id:a,nodes:i,edges:s,options:t})})}function sf(e,t,n,i=null,r=null,s=null){let a=!1;const l=()=>{a||e.destroyed()||(a=!0,pD(e,t),e.fit(t,zy(e)),Wy(e,t,r),i&&i())},u=d=>{const m=t.layout(d);m.one("layoutstop",l),m.run()},h=d=>{e.destroyed()||(console.error("[network] layout failed, falling back to a simpler one",d),s&&s(d),u({...Bf.concentric}))};if(n.name==="fcose"&&Hy()){dD(t,n).then(d=>{e.destroyed()||(t.nodes().positions(m=>d[m.id()]||m.position()),l())}).catch(h);return}try{u(n)}catch(d){h(d)}}function zy(e){var r;const t=(r=e.container())==null?void 0:r.closest("[data-network-screen]"),n=document.fullscreenElement||document.webkitFullscreenElement;if(!t||n!==t)return 20;const i=t.querySelector("[data-network-header]");return Math.max(20,(i?i.offsetHeight:0)+8)}function Wy(e,t,n){if(!n||!n.width||!n.height)return;const i=t.nodes().renderedBoundingBox();if(!i||!i.w||!i.h)return;const r=8,s=e.height()-n.height-r,a=n.width+r;if(i.y2<=s||i.x1>=a)return;const l=s-20,u=Math.min(1,l/i.h);u<1&&e.zoom({level:e.zoom()*u,renderedPosition:{x:e.width()/2,y:e.height()/2}});const d=t.nodes().renderedBoundingBox().y2-s;d>0&&e.panBy({x:0,y:-d})}function pD(e,t){const n=t.nodes();if(n.length<2)return;const i=n.boundingBox();if(!i.w||!i.h)return;const r=e.width()*.88,s=e.height()*.82,a=r/i.w,l=s/i.h,u=i.x1+i.w/2,h=i.y1+i.h/2,d={x:e.width()/2,y:e.height()/2};n.positions(m=>{const y=m.position();return{x:d.x+(y.x-u)*a,y:d.y+(y.y-h)*l}})}function gD(e,t,n){const i=t.nodes().not(".hidden");if(i.length<2)return;const r=i.boundingBox(),s=r.x1+r.w/2,a=r.y1+r.h/2;i.positions(l=>{const u=l.position();return{x:s+(u.x-s)*n,y:a+(u.y-a)*n}})}function mD(e){return e.nodes().not(".hidden").max(n=>n.degree()).ele||null}function Dv(e,t,n){const i=le(e,"[data-network-cluster-legend]");if(!i)return;if(t.length===0){i.hidden=!0;return}const r=(()=>{try{return JSON.parse(e.getAttribute("data-network-labels")||"{}")}catch{return{}}})(),a=[...t].sort((h,d)=>d.size-h.size).slice(0,8),l=n-a.length,u=r.profiles||"profiles";i.innerHTML=a.map((h,d)=>`
<span class="inline-flex items-center gap-1.5 text-xs text-theme-primary">
<span class="inline-block w-3 h-3 rounded-full" style="background-color: ${h.color};"></span>
${ce(r.cluster||"Cluster")} ${d+1} &middot; ${h.size} ${ce(u)}
</span>
`).join("")+(l>0?`<span class="text-xs text-theme-secondary">${ce(r.more||"+ :count more").replace(":count",l)}</span>`:""),i.hidden=!1}function le(e,t){return e.querySelector(t)||(e.closest("[data-network-section]")||document).querySelector(t)}function of(e,t,n){const i=e&&e.querySelector("[data-timelapse-play]");if(!i)return;const r=t==="busy",s={play:e.querySelector("[data-timelapse-icon-play]"),pause:e.querySelector("[data-timelapse-icon-pause]"),busy:e.querySelector("[data-timelapse-icon-busy]")};i.disabled=!0,i.setAttribute("title",n),i.setAttribute("aria-label",n),s.busy&&s.busy.classList.toggle("hidden",!r),s.play&&s.play.classList.toggle("hidden",r),s.pause&&s.pause.classList.add("hidden")}function vD(e,t){let n=0,i=e.length-1,r=null;for(;n<=i;){const s=n+i>>1;e[s]<=t?(r=e[s],n=s+1):i=s-1}return r}function Lv(e,t,n,{view:i,stoppedAfterDays:r,markInactive:s}){if(!n||!t||!t.till)return;const a=t.till,l=Date.parse(a),u=n.paid||{},h=n.removed||{},d=n.inactive||{};e.batch(()=>{e.nodes().forEach(m=>{const y=m.id(),x=!!h[y]&&h[y]<=a,S=!x&&!!d[y]&&d[y]<=a;if(m.hasClass("removed")!==x&&m.toggleClass("removed",x),m.hasClass("inactive")!==S&&m.toggleClass("inactive",S),i!=="circulation"||m.hasClass("outside"))return;const C=vD(u[y]||[],a);let T="neverPaid";if(C!==null){const A=Math.round((l-Date.parse(C))/864e5);T=s&&S||r!==null&&A>r?"stalled":"flowing"}m.data("flow")!==T&&(m.data("flow",T),m.data("color",By[T]||"#94a3b8"))})})}const Iv=.5,bD=30;function Nv(e){const t=Math.max(0,Math.min(100,Number(e)||0))/100;return Iv*Math.pow(bD/Iv,t)}function yD(e){return e<10?`${e.toFixed(1)}/s`:`${Math.round(e)}/s`}function Fv(e,t,n){const i=le(e,"[data-network-stagnant]");if(!i)return;const r=l=>l instanceof Set?l.size:(l||[]).length,s=(i.dataset.drawnTemplate||"").replace(":nodes",r(n.nodes)).replace(":edges",r(n.edges));i.textContent=s?`${t}: ${s}`:t,i.hidden=!1;const a=e.querySelector("[data-network-host]");a&&(a.dataset.networkSubtext=i.textContent)}function ce(e){return String(e).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}let hs={symbol:"H",atEnd:!1,thousands:"."};function xo(e){const t=(e||0)/60,n=t>=100?Math.round(t):Math.round(t*10)/10;let i=String(n).replace(".",",");if(hs.thousands){const[r,s]=i.split(","),a=r.replace(/\B(?=(\d{3})+(?!\d))/g,hs.thousands);i=s?`${a},${s}`:a}return hs.atEnd?`${i} ${hs.symbol}`:`${hs.symbol} ${i}`}function Ro(e){try{return e?JSON.parse(e):null}catch{return null}}function _D(e,t,n,i=null,r=!1){const s=e.nodes.reduce((F,H)=>Math.max(F,H.volume||0),0),a=e.nodes.reduce((F,H)=>!F||H.degree>F.degree?H:F,null),l=t&&a?a.id:null,u=e.nodes.filter(F=>F.id!==l),h=hD(u),d=new Set(u.map(F=>F.id)),m=new Map;(e.edges||[]).forEach(F=>{!d.has(F.source)||!d.has(F.target)||(m.has(F.source)||m.set(F.source,new Set),m.has(F.target)||m.set(F.target,new Set),m.get(F.source).add(F.target),m.get(F.target).add(F.source))}),u.forEach(F=>{F.totalDegree=F.degree,F.degree=(m.get(F.id)||new Set).size});const y=n==="circulation"?uD(u,e.edges||[],i,r):new Map,x=u.reduce((F,H)=>Math.max(F,H.degree||0),0),S=u.map(F=>{const H=n==="volume"?Tc(F.volume||0,s):Tc(F.degree||0,x),U=F.outside?"#94a3b8":n==="circulation"?By[(y.get(F.id)||{}).flow]||"#94a3b8":n==="region"?h[F.region]||"#64748b":cD[F.type]||"#64748b";return{data:{id:F.id,label:F.name,fullName:F.full_name||null,type:F.type,region:F.region||"",bank:F.bank||"",degree:F.degree,hiddenPartners:Math.max((F.totalDegree||F.degree)-F.degree,0),volume:F.volume,paid:F.paid||0,received:F.received||0,size:H,color:U,flow:(y.get(F.id)||{}).flow||null,flowNet:(y.get(F.id)||{}).net||0,borderW:1,outlineW:1.5,fontS:14},classes:[F.outside?"outside":"",F.removed?"removed":"",F.inactive?"inactive":""].filter(Boolean).join(" ")}}),C=new Set(S.map(F=>F.data.id)),T=e.edges.reduce((F,H)=>Math.max(F,H.volume||0),0),A=e.edges.filter(F=>C.has(F.source)&&C.has(F.target)),M=F=>T?.2+Math.pow((F||0)/T,.7)*12:.5,B=[],D=new Map,R=(F,H)=>{const U=`${F}->${H}`,V=D.get(U)||0;return D.set(U,V+1),26+V*22};A.forEach((F,H)=>{if(n!=="flow"){B.push({data:{id:`e${H}`,key:`${F.source}|${F.target}|${F.type_id}`,source:F.source,target:F.target,tx:F.tx,volume:F.volume,width:Math.min(.2+Math.pow(Math.log2(1+F.tx),1.5)*.55,12),bend:26}});return}const U=F.a_to_b||0,V=F.b_to_a||0;U>0&&B.push({data:{id:`e${H}f`,key:`${F.source}|${F.target}|${F.type_id}`,source:F.source,target:F.target,tx:F.tx,volume:U,width:M(U),bend:R(F.source,F.target),edgeColor:Mv[F.type_id]||"#64748b"},classes:"directed flowtype"}),V>0&&B.push({data:{id:`e${H}b`,key:`${F.source}|${F.target}|${F.type_id}`,source:F.target,target:F.source,tx:F.tx,volume:V,width:M(V),bend:R(F.target,F.source),edgeColor:Mv[F.type_id]||"#64748b"},classes:"directed flowtype"})});const N=a?{...a,label:a.name}:null;let I=0,j=0,q=0;return y.forEach(F=>{if(F.flow==="neverPaid")q+=1;else if(F.flow!=="stalled")return;I+=1,F.net>0&&(j+=F.net)}),{elements:[...S,...B],hub:N,droppedHub:!!l,regions:h,stagnantNodes:I,stagnantMinutes:j,neverPaidNodes:q}}async function wD(e){const t=e.querySelector("[data-network-host]");if(!t)return;const n=Z=>{const et=t.querySelector("[data-network-placeholder] span");et&&(et.textContent=Z)},i=Z=>(n(Z),new Promise(et=>{requestAnimationFrame(()=>requestAnimationFrame(et))})),r=Ro(e.getAttribute("data-network-labels"))||{};let s;try{s=JSON.parse(e.getAttribute(Ff)||"{}")}catch{n(r.drawFailed||"The network could not be drawn.");return}if(!s.nodes||s.nodes.length===0){n(r.drawEmpty||"No network to draw for this selection.");return}const a=[e.getAttribute(Ff),e.getAttribute("data-network-view"),e.getAttribute("data-network-layout"),e.getAttribute("data-hide-hub"),e.getAttribute("data-network-anonymize"),e.getAttribute("data-network-stopped-after"),e.getAttribute("data-network-mark-inactive"),e.getAttribute("data-network-timelapse"),e.getAttribute("data-network-timelapse-months"),e.getAttribute("data-network-timelapse-cumulative"),e.getAttribute("data-network-timelapse-step")].join("|");if(t.dataset.networkSignature===a&&t._cy&&!t._cy.destroyed()||t._buildingSignature===a)return;const l=(t._buildId||0)+1;t._buildId=l,t._buildingSignature=a;const u=()=>t._buildId!==l,h=Ro(e.getAttribute("data-currency"));h&&(hs=h);const d=e.getAttribute("data-hide-hub")!=="0",m=e.getAttribute("data-network-view")||"volume",y=e.getAttribute("data-network-layout")||"force";await i(r.loading||"Loading...");const x=await lD();if(u())return;const S=e.getAttribute("data-network-timelapse")==="1",C=S?Ro(e.getAttribute("data-network-timelapse-months"))||[]:[],T=e.closest("[wire\\:id]"),A=T&&window.Livewire?window.Livewire.find(T.getAttribute("wire:id")):null;let M=[],B=!1,D=null,R=null,N=null;if(S&&A&&C.length>0){of(le(e,"[data-network-timelapse-controls]"),"busy",r.timelapseLoading||"Loading the time-lapse..."),await i(r.timelapseLoading||"Loading the time-lapse...");try{const Z=await A.call("networkTimelapseData");if(u())return;const et=Z&&Z.graph;et&&(et.nodes||[]).length>0&&(s=et,D=Z.timeline||null,N=Z.volumes||null,R=qR(Z),M=Array.from({length:R.count},(ht,lt)=>R.step(lt)))}catch(Z){M=[],B=!0,console.error("[time-lapse] loading the frames failed",Z)}}const I=parseInt(e.getAttribute("data-network-stopped-after"),10);if(await i((r.preparing||"Preparing :count profiles...").replace(":count",(s.nodes||[]).length)),u())return;const{elements:j,hub:q,droppedHub:F,stagnantNodes:H,stagnantMinutes:U,neverPaidNodes:V}=_D(s,d,m,Number.isFinite(I)?I:null,e.getAttribute("data-network-mark-inactive")==="1");t._cy&&t._cy.destroy(),t._timelapse&&(t._timelapse.pause(),t._timelapse=null),t._listeners&&t._listeners.abort();const st=new AbortController;t._listeners=st;const tt=(Z,et,ht)=>{Z.addEventListener(et,ht,{signal:st.signal})},it=t.querySelector("[data-network-placeholder]");it&&(it.style.position="absolute",it.style.inset="0",it.style.zIndex="20",it.style.background="#ffffff");const K=x({container:t,elements:j,style:[{selector:"node",style:{"background-color":"data(color)",width:"data(size)",height:"data(size)",label:"data(label)","font-size":"data(fontS)","font-weight":600,"text-valign":"top","text-halign":"center","text-margin-y":-6,color:"#0f172a","text-outline-color":"#ffffff","text-outline-width":"data(outlineW)","text-opacity":0,"border-width":"data(borderW)","border-color":"rgba(0,0,0,0.25)"}},{selector:"node.removed",style:{"background-opacity":0}},{selector:"node.inactive",style:{"border-color":"#dc2626"}},{selector:"edge",style:{width:"data(width)","line-color":"#64748b","line-opacity":.8,"curve-style":"unbundled-bezier","control-point-distances":"data(bend)","control-point-weights":.5}},{selector:"node:selected, node.hovered",style:{"text-opacity":1,"border-width":2,"border-color":"#0f172a","z-index":9999}},{selector:"node.neighbour",style:{"text-opacity":1,"z-index":9998}},{selector:".faded",style:{opacity:.15}},{selector:".hidden",style:{display:"none"}},{selector:"node.found",style:{"text-opacity":1,"border-width":2,"border-color":"#000000","z-index":1e4}},{selector:".focused",style:{"text-opacity":1}},{selector:"edge.incident",style:{"line-color":"#0f172a"}},{selector:"edge.directed",style:{"curve-style":"unbundled-bezier","control-point-distances":"data(bend)","control-point-weights":.5,"target-arrow-shape":"triangle","arrow-scale":.45}},{selector:"edge.flowtype",style:{"line-color":"data(edgeColor)","target-arrow-color":"data(edgeColor)"}},{selector:"node.outside",style:{"border-style":"dashed","border-width":1.5,"border-color":"#64748b"}},{selector:"node.ghost",style:{"background-color":"data(ghostColor)","border-color":"#9ca3af","z-index":-1}},{selector:"edge.ghost",style:{"line-color":"data(ghostColor)","target-arrow-color":"data(ghostColor)","z-index":-1}},{selector:".history",style:{"z-index":-2}}],layout:{name:"preset"},motionBlur:!1,textureOnViewport:!1,minZoom:.05,maxZoom:8,wheelSensitivity:1.5}),ct={border:1,outline:1.5,font:14};let dt=null;const _t=()=>{if(K.destroyed())return;const Z=Math.max(K.zoom(),1),et=Z,ht=Math.min(Z,3);K.batch(()=>{K.nodes().forEach(lt=>{lt.data("borderW",ct.border/ht),lt.data("outlineW",ct.outline/et),lt.data("fontS",ct.font/et)})})},wt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,_t()}))};K.on("zoom",wt),_t();const vt=document.createElement("div");vt.className="stats-network-tip",vt.setAttribute("hidden",""),Object.assign(vt.style,{position:"absolute",zIndex:"20",pointerEvents:"none",background:"rgba(15,23,42,0.94)",color:"#f8fafc",padding:"7px 9px",borderRadius:"6px",fontSize:"12px",lineHeight:"1.45",whiteSpace:"nowrap",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"}),getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(vt);const Ft=le(e,"[data-network-focus]"),xt=(()=>{try{return JSON.parse(e.getAttribute("data-network-labels")||"{}")}catch{return{}}})();K.on("mouseover","node",Z=>{const et=Z.target,ht=et.closedNeighborhood();K.elements().difference(ht).addClass("faded"),et.addClass("hovered"),et.neighborhood("node").addClass("neighbour"),et.connectedEdges().addClass("incident");const lt=et.data(),Bt=[`<strong>${ce(lt.label||"")}</strong>`];if(lt.fullName&&Bt.push(`<span class="opacity-80">${ce(lt.fullName)}</span>`),Bt.push(lt.hiddenPartners>0?`${ce(xt.partners||"Partners")}: ${lt.degree} <span class="opacity-70">(${ce(xt.hidden||"hidden")}: ${lt.hiddenPartners})</span>`:`${ce(xt.partners||"Partners")}: ${lt.degree}`,`${ce(xt.paid||"Paid")}: ${xo(lt.paid)}`,`${ce(xt.received||"Received")}: ${xo(lt.received)}`,`${ce(xt.total||"Total")}: ${xo(lt.volume)}`),lt.flow){const jt=(xt.flow||{})[lt.flow];jt&&Bt.push(`${ce(xt.flowRole||"Flow")}: ${ce(jt)}`),lt.flow==="stalled"&&lt.flowNet>0&&Bt.push(`${ce(xt.stale||"Stagnant")}: ${xo(lt.flowNet)}`)}lt.bank&&Bt.push(`${ce(xt.bank||"Bank")}: ${ce(lt.bank)}`),lt.region&&Bt.push(ce(lt.region)),vt.innerHTML=Bt.join("<br>"),vt.removeAttribute("hidden")}),K.on("mousemove",Z=>{if(vt.hasAttribute("hidden"))return;const et=Z.renderedPosition||{x:0,y:0},ht=t.getBoundingClientRect(),lt=et.x+14+vt.offsetWidth>ht.width?et.x-vt.offsetWidth-14:et.x+14,Bt=et.y+14+vt.offsetHeight>ht.height?et.y-vt.offsetHeight-14:et.y+14;vt.style.left=`${Math.max(0,lt)}px`,vt.style.top=`${Math.max(0,Bt)}px`});const Ct=()=>{K.elements().removeClass(Hf),vt.setAttribute("hidden","")};K.on("mouseout","node",Ct),tt(t,"mouseleave",Ct);let Nt=null;const be=()=>{Nt=null,K.elements().removeClass("hidden focused"),sf(K,K.elements(),Rv(y,K)),Ft&&(Ft.hidden=!0)};K.on("tap","node",Z=>{const et=Z.target;if(Nt===et.id()){be();return}Nt=et.id();const ht=et.closedNeighborhood();if(K.elements().addClass("hidden"),ht.removeClass("hidden").addClass("focused"),sf(K,ht,{name:"fcose",quality:"default",animate:!1,randomize:!0,nodeRepulsion:5e3,idealEdgeLength:90}),Ft){const lt=et.neighborhood("node").length;Ft.textContent=(Ft.dataset.template||"").replace(":name",et.data("label")||"").replace(":count",lt),Ft.hidden=!1}});const Ot=le(e,"[data-network-search-input]"),St=le(e,"[data-network-search-results]"),In=()=>K.elements().removeClass("found"),De=Z=>{In(),Z.hasClass("hidden")&&be(),Z.addClass("found"),K.animate({center:{eles:Z},zoom:1.6},{duration:300})};if(Ot&&St){const Z=et=>{const ht=et.trim().toLowerCase();if(ht.length<2){St.hidden=!0,St.innerHTML="";return}const lt=jt=>{const de=jt.toLowerCase();return de===ht?0:de.startsWith(ht)?/^\s|^$/.test(de.slice(ht.length))?1:2:3},Bt=K.nodes().filter(jt=>!jt.hasClass("outside")&&String(jt.data("label")||"").toLowerCase().includes(ht)).toArray().sort((jt,de)=>{const Ie=lt(String(jt.data("label")||""))-lt(String(de.data("label")||""));return Ie!==0?Ie:(de.data("degree")||0)-(jt.data("degree")||0)}).slice(0,8);if(Bt.length===0){const jt=xt.noMatchHint?`<div class="px-3 pb-2 text-xs text-gray-500">${ce(xt.noMatchHint)}</div>`:"";St.innerHTML=`<div class="px-3 pt-2 pb-1 text-sm text-gray-500">${ce(xt.noMatch||"No match")}</div>${jt}`,St.hidden=!1;return}St.innerHTML=Bt.map(jt=>`
<button type="button" data-node-id="${ce(jt.id())}"
class="block w-full px-3 py-2 text-left text-sm hover:bg-gray-100">
<span class="font-semibold">${ce(jt.data("label")||"")}</span>
<span class="text-gray-500"> &middot; ${jt.data("degree")} ${ce(xt.partners||"")}</span>
</button>
`).join(""),St.hidden=!1};tt(Ot,"input",et=>Z(et.target.value)),tt(Ot,"search",et=>{et.target.value===""&&(In(),St.hidden=!0)}),tt(St,"mousedown",et=>{const ht=et.target.closest("[data-node-id]");if(!ht)return;et.preventDefault();const lt=K.getElementById(ht.dataset.nodeId);lt&&lt.length&&(De(lt),Ot.value=lt.data("label")||"",St.hidden=!0)}),tt(Ot,"keydown",et=>{if(et.key!=="Enter")return;et.preventDefault();const ht=St.querySelector("[data-node-id]");if(ht){const lt=K.getElementById(ht.dataset.nodeId);lt&&lt.length&&(De(lt),St.hidden=!0)}}),tt(document,"click",et=>{e.contains(et.target)||(St.hidden=!0)})}K.on("tap",Z=>{Z.target===K&&Nt&&be()});const te=1.5;[["[data-network-spread]",te],["[data-network-shrink]",1/te]].forEach(([Z,et])=>{const ht=le(e,Z);ht&&tt(ht,"click",lt=>{lt.preventDefault(),gD(K,K.elements(),et),_t()})}),aD({screenBox:le(e,"[data-network-screen]"),frameBox:le(e,"[data-network-frame]"),headerBox:le(e,"[data-network-header]"),button:le(e,"[data-network-fullscreen]"),panel:()=>le(e,"[data-network-timelapse-controls]"),signal:st.signal,onResize:()=>{if(K.destroyed())return;K.resize();const Z=K.elements().not(".hidden"),et=le(e,"[data-network-timelapse-controls]");K.fit(Z,zy(K)),Wy(K,Z,et?{width:et.offsetWidth,height:et.offsetHeight+12}:null),_t()}});const Le=le(e,"[data-network-svg]");Le&&tt(Le,"click",Z=>{Z.preventDefault();const et=e.getAttribute("data-network-anonymize")==="1",ht=Ro(e.getAttribute("data-network-meta")),lt=e.querySelector("[data-network-host]"),Bt=le(e,"[data-network-stagnant]"),jt=Bt&&!Bt.hidden?Bt.textContent.trim():"";ht&&jt?ht.subtext=jt:ht&&lt&&lt.dataset.networkSubtext&&(ht.subtext=lt.dataset.networkSubtext),ht&&lt&&lt._timelapse&&(ht.period=null);const de=jy(K,()=>TD(K,!et,ht));if(!de)return;const Ie=new Blob([de],{type:"image/svg+xml;charset=utf-8"}),qe=URL.createObjectURL(Ie),Ne=document.createElement("a");Ne.href=qe,Ne.download=(Le.dataset.filename||"trading-network")+"-"+new Date().toISOString().slice(0,10)+".svg",document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),setTimeout(()=>URL.revokeObjectURL(qe),1e3)});const re=le(e,"[data-network-drag-neighbours]"),oe=()=>!re||re.checked;let we=null;if(K.on("grab","node",Z=>{const et=Z.target;if(!oe()){we=null;return}const ht={...et.position()},lt=et.neighborhood("node").filter(Bt=>!Bt.hasClass("hidden")).map(Bt=>({node:Bt,offset:{x:Bt.position("x")-ht.x,y:Bt.position("y")-ht.y}}));we={node:et,followers:lt}}),K.on("drag","node",Z=>{if(!we||we.node.id()!==Z.target.id())return;const et=we.node.position();we.followers.forEach(({node:ht,offset:lt})=>{ht.position({x:et.x+lt.x,y:et.y+lt.y})})}),K.on("free","node",()=>{we=null}),await i((r.arranging||"Arranging :count profiles...").replace(":count",K.nodes().not(".hidden").length)),u()){K.destroy();return}const ye=()=>{it&&it.isConnected&&it.remove()};setTimeout(ye,12e4);const Ve=S?le(e,"[data-network-timelapse-controls]"):null,wn=Ve?{width:Ve.offsetWidth,height:Ve.offsetHeight+12}:null,he={view:m,stoppedAfterDays:Number.isFinite(I)?I:null,markInactive:e.getAttribute("data-network-mark-inactive")==="1"},Xt=S&&M.length>0?()=>{Nf(K,R.layers(0)),Lv(K,M[0],D,he)}:null,xe=le(e,"[data-network-warning]");if(xe){const Z=xe.querySelector("[data-network-warning-text]");Z&&(Z.textContent=""),xe.hidden=!1}let Ae;const xn=new Promise(Z=>{Ae=Z});if(sf(K,K.elements(),Rv(y,K),()=>{Xt&&Xt(),ye(),Ae()},wn,Z=>{const et=xe&&xe.querySelector("[data-network-warning-text]");et&&(et.textContent=`${r.layoutFallback||"The usual arrangement failed, so a simpler one is shown."} (${Z.message||Z})`)}),m==="cluster"){const et=K.nodes().not(".hidden").length;if(et>600){Dv(e,[],0);const ht=le(e,"[data-network-warning]"),lt=ht&&ht.querySelector("[data-network-warning-text]");ht&&lt&&(lt.textContent=(e.getAttribute("data-cluster-too-large")||"").replace(":count",et).replace(":limit",600))}else{if(await i((r.clustering||"Finding clusters in :count profiles, this can take a moment...").replace(":count",et)),u()){K.destroy();return}try{const ht=K.elements().markovClustering(),lt=[];ht.forEach((Bt,jt)=>{const de=Cc[jt%Cc.length],Ie=Bt.nodes().filter(qe=>!qe.hasClass("outside"));Ie.forEach(qe=>qe.data("color",de)),Ie.length>1&&lt.push({color:de,size:Ie.length})}),Dv(e,lt,ht.length)}catch{}}}const Yt=le(e,"[data-network-timelapse-controls]");if(S&&M.length>0&&Yt)try{const Z=Yt.querySelector("[data-timelapse-play]"),et=Yt.querySelector("[data-timelapse-scrubber]"),ht=Yt.querySelector("[data-timelapse-year]"),lt=Yt.querySelector("[data-timelapse-speed]"),Bt=r.timelapsePlay||"Play",jt=r.timelapsePause||"Pause",de=Yt.querySelector("[data-timelapse-icon-play]"),Ie=Yt.querySelector("[data-timelapse-icon-pause]"),qe=Yt.querySelector("[data-timelapse-icon-busy]"),Ne=$t=>{if(!Z)return;const _e=$t?jt:Bt;Z.setAttribute("title",_e),Z.setAttribute("aria-label",_e),de&&Ie&&(de.classList.toggle("hidden",$t),Ie.classList.toggle("hidden",!$t)),qe&&qe.classList.add("hidden"),Z.disabled=!1},Zi=(s.nodes||[]).reduce(($t,_e)=>Math.max($t,_e.volume||0),0),Qi=(s.nodes||[]).reduce(($t,_e)=>Math.max($t,_e.degree||0),0);XR(K);const tr=QR(K,R,N),er=($t,_e)=>m==="volume"?Tc(tr.volumeAt($t,_e),Zi):Tc(tr.degreeAt($t,_e),Qi),Fr=e.getAttribute("data-network-timelapse-step")==="week"?30.44/7:1,Br=$t=>1e3/($t*Fr),Nn=sD({cy:K,sizeOf:er,changedAt:tr.changedAt,count:M.length,layersAt:$t=>R.layers($t),interval:Br(Nv(lt?lt.value:36)),holdAtEnd:3e3,onFrame:$t=>{const _e=M[$t];Lv(K,_e,D,he),ht&&(ht.textContent=_e.label||""),et&&(et.value=$t),Ne(Nn.isPlaying()),Fv(e,_e.label||"",R.layers($t).current)}});et&&(et.max=String(Math.max(0,M.length-1)),et.value="0",tt(et,"input",()=>{Nn.goTo(parseInt(et.value,10)||0),Ne(!1)})),lt&&tt(lt,"input",()=>{const $t=Nv(lt.value);Nn.setInterval(Br($t));const _e=Yt.querySelector("[data-timelapse-speed-value]");_e&&(_e.textContent=yD($t))}),Z&&tt(Z,"click",()=>{Nn.isPlaying()?(Nn.pause(),Ne(!1)):(Nn.play(),Ne(!0))}),xn.then(()=>{K.destroyed()||u()||(Nf(K,R.layers(0),$t=>er($t,0)),Ne(!1))}),ht&&(ht.textContent=M[0].label||""),t._timelapseFirst={year:M[0].label||"",frame:R.layers(0).current},t._timelapse=Nn}catch(Z){console.error("[time-lapse] setting up playback failed",Z),of(Yt,"error",r.timelapseFailed||"The time-lapse could not be loaded.")}else S&&Yt?of(Yt,"error",B?r.timelapseFailed||"The time-lapse could not be loaded.":r.timelapseEmpty||"Nothing to animate for this selection."):t._timelapse&&(t._timelapse.pause(),t._timelapse=null);t._cy=K,t.dataset.networkSignature=a,t._buildingSignature=null,window.statsNetworkChart=K;const Se=le(e,"[data-network-stagnant]");if(Se){const Z=K.nodes().not(".hidden").length,et=K.edges().not(".hidden").length,ht=(Se.dataset.drawnTemplate||"").replace(":nodes",Z).replace(":edges",et),lt=m==="circulation"&&H>0?(Se.dataset.template||"").replace(":count",H).replace(":never",V).replace(":hours",xo(U)):"";Se.textContent=[ht,lt].filter(Boolean).join(" "),Se.hidden=!1,t.dataset.networkSubtext=Se.textContent,t._timelapseFirst&&(Fv(e,t._timelapseFirst.year,t._timelapseFirst.frame),t._timelapseFirst=null)}const fe=le(e,"[data-network-note]");fe&&F&&q?(fe.textContent=fe.dataset.template?fe.dataset.template.replace(":name",q.label||"").replace(":count",q.degree):"",fe.hidden=!1):fe&&(fe.hidden=!0),window.statsNetwork=K}window.exportNetworkForPdf=function(){if(window.__networkSnapshot){const e=window.__networkSnapshot;return window.__networkSnapshot=null,e}return $y()};function xD(e,t,n,i){const r=e&&e.logo&&e.logo.svg?String(e.logo.svg):"",s=/viewBox="([^"]+)"/.exec(r);if(!r||!s||n<=0)return null;const[,,a,l]=s[1].trim().split(/[\s,]+/).map(Number);if(!(a>0)||!(l>0))return null;const u=r.replace(/^[\s\S]*?<svg\b[^>]*>/,"").replace(/<\/svg>\s*$/,""),h=Math.max(20,n-16),d=h*(a/l),m=t-i-d,y=8,x=String(e.logo.color||"#000000").replace(/[^#0-9a-zA-Z(),. ]/g,"");return{defs:' <filter id="logo-halo" x="-15%" y="-15%" width="130%" height="130%"><feMorphology in="SourceAlpha" operator="dilate" radius="1.5" result="grown"/><feFlood flood-color="#ffffff"/><feComposite in2="grown" operator="in" result="halo"/><feMerge><feMergeNode in="halo"/><feMergeNode in="SourceGraphic"/></feMerge></filter>',body:`<g filter="url(#logo-halo)"><svg x="${m.toFixed(2)}" y="${y}" width="${d.toFixed(2)}" height="${h.toFixed(2)}" viewBox="${s[1]}" preserveAspectRatio="xMaxYMin meet" fill="${x}">${u}</svg></g>`,x:m,bottom:y+h}}let us;function SD(e,t,n=400){if(us===void 0)try{us=document.createElement("canvas").getContext("2d")||null}catch{us=null}return us?(us.font=`${n} ${t}px Helvetica, Arial, sans-serif`,us.measureText(e).width):String(e).length*t*(n>=600?.58:.52)}function Bv(e,t,n,i){const r=String(e).split(/\s+/).filter(Boolean),s=[];let a="";return r.forEach(l=>{const u=a?`${a} ${l}`:l;a&&SD(u,t,n)>i?(s.push(a),a=l):a=u}),a&&s.push(a),s}function TD(e,t=!0,n=null){if(!e||e.destroyed()||e.nodes().length===0)return null;const i=e.width(),r=e.height(),s=e.pan(),a=e.zoom(),l=16,u=n?40+(n.period?12:0)+(n.subtext?16:0):0,h=xD(n,i,u,l),d=h?h.x-12:i-l,m=[];if(n){const H=[{text:n.caption,size:15,weight:600,fill:"#0f172a"},{text:n.period,size:11,weight:400,fill:"#64748b"},{text:n.subtext,size:10,weight:400,fill:"#64748b"}];let U=0;H.filter(V=>V.text).forEach(V=>{Bv(V.text,V.size,V.weight,d-l).forEach(st=>{U=U===0?22:U+V.size+5,m.push({...V,text:st,y:U})})})}const y=m.length?m[m.length-1].y:0,x=n?Math.max(u,y+14,h?h.bottom+8:0):0,S=n&&n.colors?n.colors.length:0,C=n&&n.directions?n.directions.length:0,T=n&&n.nodeStyles?n.nodeStyles.length:0,A=n&&n.hint?Bv(n.hint,10,400,i-2*l):[],M=n?60+A.length*14+(A.length?6:0)+Math.ceil(S/2)*18+Math.ceil(C/2)*18+Math.ceil(T/2)*18+(n.settings?34:0):0,B=x+r+M,D=H=>({x:H.x*a+s.x,y:H.y*a+s.y+x}),R=H=>String(H).replace(/[&<>"']/g,U=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[U]),N=H=>{const U=String(H).match(/rgba?\(([^)]+)\)/);if(!U)return{color:H||"#000",alpha:1};const V=U[1].split(",").map(st=>parseFloat(st.trim()));return{color:`rgb(${V[0]},${V[1]},${V[2]})`,alpha:V.length>3?V[3]:1}},I=(H,U)=>{const V=H.pstyle(U).value;return Array.isArray(V)&&V.length>=3?{color:`rgb(${V[0]},${V[1]},${V[2]})`,alpha:V.length>3&&Number.isFinite(V[3])?V[3]:1}:N(H.style(U))},j=[];e.edges().forEach(H=>{if(H.hasClass("hidden")||H.style("display")==="none")return;const U=D(H.source().position()),V=D(H.target().position()),st=I(H,"line-color"),tt=(parseFloat(H.style("width"))||1)*a,it=_t=>{const wt=parseFloat(H.style(_t));return Number.isFinite(wt)?wt:1},K=it("line-opacity")*it("opacity"),ct=parseFloat(H.style("control-point-distances"))||0;let dt;if(ct){const _t=(U.x+V.x)/2,wt=(U.y+V.y)/2,vt=V.x-U.x,Ft=V.y-U.y,xt=Math.sqrt(vt*vt+Ft*Ft)||1,Ct=_t-Ft/xt*ct*a,Nt=wt+vt/xt*ct*a;dt=`M ${U.x.toFixed(2)} ${U.y.toFixed(2)} Q ${Ct.toFixed(2)} ${Nt.toFixed(2)} ${V.x.toFixed(2)} ${V.y.toFixed(2)}`}else dt=`M ${U.x.toFixed(2)} ${U.y.toFixed(2)} L ${V.x.toFixed(2)} ${V.y.toFixed(2)}`;if(j.push(`<path d="${dt}" fill="none" stroke="${st.color}" stroke-opacity="${(st.alpha*K).toFixed(3)}" stroke-width="${tt.toFixed(2)}" stroke-linecap="round"/>`),H.style("target-arrow-shape")==="triangle"){const _t=I(H,"target-arrow-color"),wt=parseFloat(H.style("arrow-scale"))||1,vt=Math.min(Math.max(tt*3*wt,3.5),10),Ct=(parseFloat(H.target().style("width"))||10)*a/2+1.5;let Nt,be,Ot,St;if(ct){const Le=(U.x+V.x)/2,re=(U.y+V.y)/2,oe=V.x-U.x,we=V.y-U.y,ye=Math.sqrt(oe*oe+we*we)||1,Ve=Le-we/ye*ct*a,wn=re+oe/ye*ct*a,he=Z=>{const et=1-Z;return{x:et*et*U.x+2*et*Z*Ve+Z*Z*V.x,y:et*et*U.y+2*et*Z*wn+Z*Z*V.y}};let Xt=0,xe=1;for(let Z=0;Z<40;Z+=1){const et=(Xt+xe)/2,ht=he(et);Math.hypot(ht.x-V.x,ht.y-V.y)>Ct?Xt=et:xe=et}const Ae=Xt,xn=he(Ae);Nt=xn.x,be=xn.y;const Yt=2*(1-Ae)*(Ve-U.x)+2*Ae*(V.x-Ve),Se=2*(1-Ae)*(wn-U.y)+2*Ae*(V.y-wn),fe=Math.hypot(Yt,Se)||1;Ot=Yt/fe,St=Se/fe}else{const Le=V.x-U.x,re=V.y-U.y,oe=Math.hypot(Le,re)||1;Ot=Le/oe,St=re/oe,Nt=V.x-Ot*Ct,be=V.y-St*Ct}const In=Nt-Ot*vt,De=be-St*vt,te=Math.max(vt*.8,tt*1.15)/2;j.push(`<polygon points="${Nt.toFixed(2)},${be.toFixed(2)} ${(In-St*te).toFixed(2)},${(De+Ot*te).toFixed(2)} ${(In+St*te).toFixed(2)},${(De-Ot*te).toFixed(2)}" fill="${_t.color}" fill-opacity="${(_t.alpha*K).toFixed(3)}"/>`)}});const q=[];e.nodes().forEach(H=>{if(H.hasClass("hidden")||H.style("display")==="none")return;const U=D(H.position()),V=(parseFloat(H.style("width"))||10)*a/2,st=I(H,"background-color"),tt=I(H,"border-color"),it=(parseFloat(H.style("border-width"))||0)*a,K=Nt=>{const be=parseFloat(H.style(Nt));return Number.isFinite(be)?be:1},ct=K("opacity"),dt=st.alpha*K("background-opacity")*ct,_t=tt.alpha*K("border-opacity")*ct;j.push(`<circle cx="${U.x.toFixed(2)}" cy="${U.y.toFixed(2)}" r="${V.toFixed(2)}" `+(dt>0?`fill="${st.color}" fill-opacity="${dt.toFixed(3)}"`:'fill="none"')+(it>0?` stroke="${tt.color}" stroke-opacity="${_t.toFixed(3)}" stroke-width="${it.toFixed(2)}"`:"")+"/>");const wt=t?H.data("label"):null;if(!wt)return;const vt=(parseFloat(H.style("font-size"))||14)*a,Ft=I(H,"text-outline-color"),xt=(parseFloat(H.style("text-outline-width"))||0)*a,Ct=U.y-V-6*a;q.push(`<text x="${U.x.toFixed(2)}" y="${Ct.toFixed(2)}" text-anchor="middle" font-family="Helvetica, Arial, sans-serif" font-size="${vt.toFixed(2)}" font-weight="600" fill="#0f172a"`+(xt>0?` stroke="${Ft.color}" stroke-width="${(xt*2).toFixed(2)}" paint-order="stroke fill" stroke-linejoin="round"`:"")+`>${R(wt)}</text>`)});const F=[];if(n){const H=(tt,it,K,ct={})=>`<text x="${tt.toFixed(2)}" y="${it.toFixed(2)}" font-family="Helvetica, Arial, sans-serif" font-size="${(ct.size||11).toFixed(2)}" font-weight="${ct.weight||400}" fill="${ct.fill||"#0f172a"}">${R(K)}</text>`;x>0&&F.push(`<rect x="0" y="0" width="${i}" height="${x}" fill="#ffffff"/>`),m.forEach(tt=>{F.push(H(l,tt.y,tt.text,{size:tt.size,weight:tt.weight,fill:tt.fill}))}),h&&F.push(h.body);const U=x+r;F.push(`<rect x="0" y="${U}" width="${i}" height="${(B-U).toFixed(2)}" fill="#ffffff"/>`),F.push(`<line x1="${l}" y1="${(U+8).toFixed(2)}" x2="${(i-l).toFixed(2)}" y2="${(U+8).toFixed(2)}" stroke="#e2e8f0" stroke-width="1"/>`);let V=U+28;A.forEach(tt=>{F.push(H(l,V,tt,{size:10,fill:"#334155"})),V+=14}),A.length&&(V+=6),n.colorMeaning&&(F.push(H(l,V,n.colorMeaning,{size:10,fill:"#64748b"})),V+=16),(n.colors||[]).forEach((tt,it)=>{const K=it%2,ct=l+K*(i/2-l),dt=Math.floor(it/2),_t=V+dt*18;F.push(`<rect x="${ct.toFixed(2)}" y="${(_t-8).toFixed(2)}" width="10" height="10" rx="5" fill="${tt.color}"/>`),F.push(H(ct+16,_t,tt.label,{size:10}))}),V+=Math.ceil((n.colors||[]).length/2)*18+6;const st=[];n.sizeMeaning&&st.push(`${n.sizeLabel||"Dot size"}: ${n.sizeMeaning}`),n.widthMeaning&&st.push(`${n.widthLabel||"Line thickness"}: ${n.widthMeaning}`),st.length&&(F.push(H(l,V,st.join(" · "),{size:10,fill:"#64748b"})),V+=18),(n.nodeStyles||[]).forEach((tt,it)=>{const K=it%2,ct=l+K*(i/2-l),dt=Math.floor(it/2),_t=V+dt*18,wt=N(tt.color);F.push(`<circle cx="${(ct+5).toFixed(2)}" cy="${(_t-3).toFixed(2)}" r="5" fill="${tt.hollow?"none":"#94a3b8"}" stroke="${wt.color}" stroke-opacity="${wt.alpha.toFixed(3)}" stroke-width="2"${tt.dashed?' stroke-dasharray="3 2"':""}/>`),F.push(H(ct+16,_t,tt.label,{size:10}))}),(n.nodeStyles||[]).length&&(V+=Math.ceil(n.nodeStyles.length/2)*18+6),(n.directions||[]).forEach((tt,it)=>{const K=it%2,ct=l+K*(i/2-l),dt=Math.floor(it/2),_t=V+dt*18;F.push(`<rect x="${ct.toFixed(2)}" y="${(_t-5).toFixed(2)}" width="16" height="3" rx="1.5" fill="${tt.color}"/>`),F.push(H(ct+22,_t,tt.label,{size:10}))}),(n.directions||[]).length&&(V+=Math.ceil(n.directions.length/2)*18+6),n.settings&&F.push(H(l,V,n.settings,{size:9,fill:"#94a3b8"}))}return`<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${B}" viewBox="0 0 ${i} ${B}">
<rect width="100%" height="100%" fill="#ffffff"/>
<defs>
<clipPath id="graph-frame">
<rect x="0" y="${x}" width="${i}" height="${r}"/>
</clipPath>
${h?h.defs:""}
</defs>
<g clip-path="url(#graph-frame)">
${j.join(`
`)}
${q.join(`
`)}
</g>
${F.join(`
`)}
</svg>
`}const Hf="faded neighbour hovered incident";function jy(e,t){const n={};Hf.split(" ").forEach(i=>{n[i]=e.elements(`.${i}`)}),e.batch(()=>e.elements().removeClass(Hf));try{return t()}finally{e.batch(()=>{Object.entries(n).forEach(([i,r])=>r.addClass(i))})}}function $y(){try{const e=window.statsNetworkChart;if(!e||e.destroyed()||e.nodes().length===0)return null;const t=2;return jy(e,()=>e.png({output:"base64uri",bg:"#ffffff",full:!1,scale:t}))}catch{return null}}typeof document<"u"&&document.addEventListener("click",e=>{e.target.closest("[data-network-pdf-trigger]")&&(window.__networkSnapshot=$y())},!0);function CD(){window.LaravelFlatpickr&&document.querySelectorAll("[data-network-timelapse-end] .flatpickr-input").forEach(e=>{e._flatpickr||window.LaravelFlatpickr.initializeFlatpickr(e)})}function yd(){document.querySelectorAll(`[${Ff}]`).forEach(e=>{wD(e).catch(t=>{const n=e.querySelector("[data-network-host]");n&&(n._buildingSignature=null),console.error("[network] drawing failed",t);const i=n&&n.querySelector("[data-network-placeholder] span");if(i){const r=Ro(e.getAttribute("data-network-labels"))||{};i.textContent=`${r.drawFailed||"The network could not be drawn."} (${t&&t.message||t})`}})})}document.addEventListener("DOMContentLoaded",()=>setTimeout(yd,100));document.addEventListener("livewire:init",()=>{let e=null,t=!1;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(yd,300),t||(t=!0,requestAnimationFrame(()=>{t=!1,CD()}))})});document.addEventListener("livewire:navigated",()=>setTimeout(yd,100));Jt.register(...Hc);const OD=[{canvasId:"reportBalanceDistributionChart",dataAttribute:"data-report-balance-distribution",field:"User",color:"#14b8a6"},{canvasId:"reportBalanceDistributionOrgChart",dataAttribute:"data-report-balance-distribution-org",field:"Organization",color:"#d946ef"}];function kD(e){var u;const t=document.getElementById(e.canvasId);if(!t||typeof Jt>"u")return;const n=t.closest(`[${e.dataAttribute}]`);if(!n)return;let i;try{i=JSON.parse(n.getAttribute(e.dataAttribute)||"[]")}catch{return}if(!Array.isArray(i)||i.length===0)return;let r={};try{r=JSON.parse(n.getAttribute("data-series-labels")||"{}")}catch{r={}}const s=n.getAttribute(e.dataAttribute);if(t.dataset.chartSignature===s&&((u=Jt.getChart)!=null&&u.call(Jt,t)))return;const a=Jt.getChart?Jt.getChart(t):null;a&&a.destroy();const l=[{label:r[e.field]||e.field,data:i.map(h=>h[e.field]||0),backgroundColor:e.color,borderColor:e.color,borderWidth:1}];t.chart=new Jt(t.getContext("2d"),{type:"bar",data:{labels:i.map(h=>h.label),datasets:l},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{bottom:16}},plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0,drawOnChartArea:!0,offset:!1,color:"rgba(0, 0, 0, 0.10)"},ticks:{padding:8,autoSkip:!1,maxRotation:60,minRotation:60,font:{size:10}}}}}}),t.dataset.chartSignature=s}function _d(){OD.forEach(kD)}document.addEventListener("DOMContentLoaded",()=>{setTimeout(_d,100)});document.addEventListener("livewire:init",()=>{let e=null;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(_d,300)})});document.addEventListener("livewire:navigated",()=>{setTimeout(_d,100)});window.exportBalanceDistributionChartForPdf=async function(e){try{const t=document.getElementById(e);if(!t)return null;const n=Jt.getChart?Jt.getChart(t):null;if(!n)return null;const i=2,r=674,s=300,a=document.createElement("canvas");a.width=r*i,a.height=s*i;const l=new Jt(a.getContext("2d"),{type:n.config.type,data:JSON.parse(JSON.stringify(n.config.data)),options:{...JSON.parse(JSON.stringify(n.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1,devicePixelRatio:i}});await new Promise(h=>setTimeout(h,300));const u=a.toDataURL("image/png",1);return l.destroy(),u}catch{return null}};window.__showProfileSwitchBanner=function(e){const t=document.getElementById("profile-switch-banner");if(!t)return;const n=document.getElementById("profile-switch-banner-photo");n&&(n.style.display="none");const i=document.getElementById("profile-switch-banner-role");i&&(i.style.display="none",i.textContent=""),e.photo&&n&&(n.src=e.photo,n.alt=e.name||"",n.style.display="block");const r=document.getElementById("profile-switch-banner-name");r&&(r.textContent=e.name||""),i&&e.roleLabel&&(i.textContent=e.roleLabel,i.style.display="block"),t.style.opacity="1",t.style.transition="",t.style.display="flex",t.addEventListener("click",()=>{t.style.display="none"},{once:!0}),setTimeout(()=>{t.style.transition="opacity 0.4s",t.style.opacity="0",setTimeout(()=>{t.style.display="none",t.style.opacity="",t.style.transition=""},400)},3e3)};Alpine.plugin(ik);Jt.register(...Hc);window.Chart=Jt;window.createPopper=NO;window.Tagify=Ql;window.loadJSZip=()=>af(()=>import("./jszip.min-KAUKf24L.js").then(e=>e.j),__vite__mapDeps([2,1])).then(e=>e.default);document.addEventListener("alpine:init",()=>{Alpine.data("callTagPicker",()=>({callTagify:null,init(){const e=this.$refs.callTagsInput,t=JSON.parse(e.dataset.suggestions||"[]");this.callTagify=new Tagify(e,{maxTags:1,whitelist:t,enforceWhiteList:!1,backspace:!1,editTags:!1,addTagOn:["enter","tab","blur"],addTagOnBlur:!0,dropdown:{maxItems:10,enabled:2,closeOnSelect:!0,highlightFirst:!0}});const n=this.$wire.get("tagsArray");n&&n!=="[]"&&this.callTagify.loadOriginalValues(n),this.callTagify.on("change",()=>{const i=this.$refs.callTagsInput.value,r=JSON.parse(i||"[]");if(r.length===0){this.$wire.set("tagsArray","[]",!1),this.$wire.call("notifyTagCleared");return}const s=r[0];s.tag_id?(this.$wire.set("tagsArray",i,!1),this.$wire.call("notifyTagSelected",s.tag_id)):this.$wire.call("openNewTagModal",s.value)}),window.addEventListener("removeLastCallTag",()=>{this.callTagify&&this.callTagify.value.length>0&&this.callTagify.removeTag(this.callTagify.value[this.callTagify.value.length-1].value)}),Livewire.on("callTagifyReload",i=>{this.callTagify.loadOriginalValues(i.tagsArray)})}}))});window.Pusher=Pk;const AD=()=>{const e=window.location.pathname.split("/").filter(Boolean),t=["en","nl","de","es","fr"];return e.length>0&&t.includes(e[0])?`/${e[0]}`:"/en"};var Hv;window.Echo=new kk({broadcaster:"reverb",key:"aj7hptmqiercfnc5cpwu",wsHost:"localhost",wsPort:"8080",wssPort:"8080",wsPath:"/",forceTLS:!1,enabledTransports:["ws","wss"],authEndpoint:`${AD()}/broadcasting/auth`,auth:{headers:{"X-CSRF-TOKEN":(Hv=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Hv.getAttribute("content")}}});